fiftyone.mobile.detection.entities.stream
Class TrieSource

java.lang.Object
  extended by fiftyone.mobile.detection.entities.stream.TrieSource
All Implemented Interfaces:
Disposable

public class TrieSource
extends Object
implements Disposable

Encapsulates either a byte array or a file containing the uncompressed data structures used by the data set.

Must be disposed to ensure that the readers are closed and the file free for other uses. Does not need to be disposed if a byte array is used.


Field Summary
private  FileInputStream fileInputStream
           
 
Constructor Summary
TrieSource(String filename)
           
 
Method Summary
 TrieReader createReader()
          Creates a new reader and stores a reference to it.
 void dispose()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

fileInputStream

private final FileInputStream fileInputStream
Constructor Detail

TrieSource

public TrieSource(String filename)
           throws FileNotFoundException
Throws:
FileNotFoundException
Method Detail

dispose

public void dispose()
Specified by:
dispose in interface Disposable

createReader

public TrieReader createReader()
                        throws IOException
Creates a new reader and stores a reference to it.

Returns:
A reader open for read access to the stream
Throws:
IOException