public abstract class InputFactory
extends java.lang.Object
implements java.io.Closeable
Constructor and Description |
---|
InputFactory() |
Modifier and Type | Method and Description |
---|---|
static InputFactory |
createByteStoreFactory(ByteStore byteStore)
Returns an input factory based on a populated bytestore.
|
static InputFactory |
createFactory(DataSource datsrc,
long offset,
long leng)
Constructs an instance of this class to read a given data source.
|
static InputFactory |
createFileFactory(java.io.File uncompressedFile,
long offset,
long leng)
Constructs an instance of this class to read a given uncompressed file.
|
abstract BasicInput |
createInput(boolean isSeq)
Returns a BasicInput instance to read this object's byte stream.
|
static InputFactory |
createRandomFactory(DataSource datsrc,
long offset,
long leng,
StoragePolicy policy)
Returns an InputFactory for which random access is guaranteed.
|
static InputFactory |
createSequentialFactory(DataSource datsrc,
long offset,
long leng)
Constructs an instance of this class to read a given data source
viewed as a stream, not a file.
|
static BasicInput |
createSequentialInput(java.io.InputStream in)
Returns a non-random-access BasicInput based on a supplied input stream.
|
abstract boolean |
isRandom()
Indicates whether the BasicInput objects created by this factory
will support random access.
|
public abstract boolean isRandom()
public abstract BasicInput createInput(boolean isSeq) throws java.io.IOException
isSeq
- if true, the returned object is expected to be used
for sequential access only; this value is a hint
which may or may not be used by the implementationjava.io.IOException
public static InputFactory createFactory(DataSource datsrc, long offset, long leng) throws java.io.IOException
datsrc
- data sourceoffset
- offset into file of stream startleng
- number of bytes in streamjava.io.IOException
public static InputFactory createSequentialFactory(DataSource datsrc, long offset, long leng)
datsrc
- data sourceoffset
- offset into file of stream startleng
- number of bytes in streampublic static InputFactory createFileFactory(java.io.File uncompressedFile, long offset, long leng) throws java.io.IOException
uncompressedFile
- unencoded fileoffset
- offset into file of stream startleng
- number of bytes in streamjava.io.IOException
public static InputFactory createRandomFactory(DataSource datsrc, long offset, long leng, StoragePolicy policy) throws java.io.IOException
datsrc
- data sourceoffset
- offset into file of stream startleng
- number of bytes in streampolicy
- storage policy for caching if required,
or null for defaultjava.io.IOException
public static InputFactory createByteStoreFactory(ByteStore byteStore) throws java.io.IOException
byteStore
- cache containing byte contentjava.io.IOException
public static BasicInput createSequentialInput(java.io.InputStream in)
in
- input stream