public class TempFileCharacterInput extends CharacterInput
Modifier and Type | Field and Description |
---|---|
static String |
_rcsid |
protected static int |
CHUNK_SIZE |
protected static int |
DEFAULT_MAX_MEM_SIZE |
protected File |
file |
protected byte[] |
inMemoryBuffer |
charLength, hashValue, stream
Modifier | Constructor and Description |
---|---|
protected |
TempFileCharacterInput() |
|
TempFileCharacterInput(File tempFile)
Construct from an existing temporary fle.
|
|
TempFileCharacterInput(Reader is)
Construct from a non-length-delimited reader.
|
|
TempFileCharacterInput(Reader is,
long length)
Construct from a length-delimited reader.
|
|
TempFileCharacterInput(Reader is,
long length,
int maxInMemoryLength)
Construct from a length-delimited reader.
|
Modifier and Type | Method and Description |
---|---|
protected void |
calculateHashValue()
Calculate the datum's hash value
|
protected void |
calculateLength()
Calculate the datum's length in characters
|
void |
discard()
Discard this object permanently
|
InputStream |
getUtf8Stream()
Open a Utf8 stream directly from the backing file
|
long |
getUtf8StreamLength()
Get binary UTF8 stream length directly
|
protected void |
openStream()
Open a reader, for use by a caller, until closeStream is called
|
CharacterInput |
transfer()
Transfer to a new object; this causes the current object to become "already discarded"
|
closeStream, doneWithStream, getCharacterLength, getHashValue, getStream, handleIOException
public static final String _rcsid
protected File file
protected byte[] inMemoryBuffer
protected static final int CHUNK_SIZE
protected static final int DEFAULT_MAX_MEM_SIZE
public TempFileCharacterInput(Reader is) throws ManifoldCFException, IOException
is
- is a reader to transfer from, to the end of the data. This will, as a side effect, also calculate the character length
and hash value for the data.ManifoldCFException
IOException
public TempFileCharacterInput(Reader is, long length) throws ManifoldCFException, IOException
is
- is a reader to transfer from, to the end of the data. This will, as a side effect, also calculate the character length
and hash value for the data.length
- is the length limit to transfer, or -1 if no limitManifoldCFException
IOException
public TempFileCharacterInput(Reader is, long length, int maxInMemoryLength) throws ManifoldCFException, IOException
is
- is a reader to transfer from, to the end of the data. This will, as a side effect, also calculate the character length
and hash value for the data.length
- is the length limit to transfer, or -1 if no limitmaxInMemoryLength
- is the maximum size to keep in memory, before using a backing File object. The amount possibly
saved in memory will be guaranteed less than this size.ManifoldCFException
IOException
public TempFileCharacterInput(File tempFile)
tempFile
- is the existing temporary file, encoded in utf-8.protected TempFileCharacterInput()
public InputStream getUtf8Stream() throws ManifoldCFException
getUtf8Stream
in class CharacterInput
ManifoldCFException
public long getUtf8StreamLength() throws ManifoldCFException
getUtf8StreamLength
in class CharacterInput
ManifoldCFException
protected void openStream() throws ManifoldCFException
CharacterInput
openStream
in class CharacterInput
ManifoldCFException
public CharacterInput transfer()
transfer
in class CharacterInput
public void discard() throws ManifoldCFException
CharacterInput
discard
in class CharacterInput
ManifoldCFException
protected void calculateLength() throws ManifoldCFException
calculateLength
in class CharacterInput
ManifoldCFException
protected void calculateHashValue() throws ManifoldCFException
calculateHashValue
in class CharacterInput
ManifoldCFException