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, handleIOExceptionpublic 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.ManifoldCFExceptionIOExceptionpublic 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 limitManifoldCFExceptionIOExceptionpublic 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.ManifoldCFExceptionIOExceptionpublic TempFileCharacterInput(File tempFile)
tempFile - is the existing temporary file, encoded in utf-8.protected TempFileCharacterInput()
public InputStream getUtf8Stream() throws ManifoldCFException
getUtf8Stream in class CharacterInputManifoldCFExceptionpublic long getUtf8StreamLength()
throws ManifoldCFException
getUtf8StreamLength in class CharacterInputManifoldCFExceptionprotected void openStream()
throws ManifoldCFException
CharacterInputopenStream in class CharacterInputManifoldCFExceptionpublic CharacterInput transfer()
transfer in class CharacterInputpublic void discard()
throws ManifoldCFException
CharacterInputdiscard in class CharacterInputManifoldCFExceptionprotected void calculateLength()
throws ManifoldCFException
calculateLength in class CharacterInputManifoldCFExceptionprotected void calculateHashValue()
throws ManifoldCFException
calculateHashValue in class CharacterInputManifoldCFException