Class SimpleCharStream
java.lang.Object
com.yahoo.search.query.textserialize.parser.AbstractCharStream
com.yahoo.search.query.textserialize.parser.SimpleCharStream
- All Implemented Interfaces:
CharStream
An implementation of interface CharStream, where the stream is assumed to
contain only ASCII characters (without unicode processing).
-
Field Summary
Fields inherited from class com.yahoo.search.query.textserialize.parser.AbstractCharStream
available, buffer, bufpos, bufsize, DEFAULT_BUF_SIZE, inBuf, maxNextCharInd, tokenBegin
-
Constructor Summary
ConstructorDescriptionSimpleCharStream
(InputStream dstream, String encoding) Constructor.SimpleCharStream
(InputStream dstream, String encoding, int startline, int startcolumn) Constructor.SimpleCharStream
(InputStream dstream, String encoding, int startline, int startcolumn, int buffersize) Constructor.SimpleCharStream
(Reader dstream) Constructor.SimpleCharStream
(Reader dstream, int startline, int startcolumn) Constructor.SimpleCharStream
(Reader dstream, int startline, int startcolumn, int buffersize) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionvoid
reInit
(InputStream dstream, String encoding) Reinitialise.void
reInit
(InputStream dstream, String encoding, int startline, int startcolumn) Reinitialise.void
reInit
(InputStream dstream, String encoding, int startline, int startcolumn, int buffersize) Reinitialise.void
Reinitialise.void
Reinitialise.void
Reinitialise.protected void
Close the underlying stream.protected int
streamRead
(char[] aBuf, int nOfs, int nLen) Read from the underlying stream.Methods inherited from class com.yahoo.search.query.textserialize.parser.AbstractCharStream
adjustBeginLineColumn, backup, beginToken, done, expandBuff, fillBuff, getBeginColumn, getBeginLine, getBufSizeAfterExpansion, getColumn, getEndColumn, getEndLine, getImage, getLine, getSuffix, getTabSize, internalAdjustBuffSize, internalSetBufLineColumn, internalUpdateLineColumn, isTrackLineColumn, readChar, reInit, setTabSize, setTrackLineColumn
-
Constructor Details
-
SimpleCharStream
Constructor. -
SimpleCharStream
Constructor. -
SimpleCharStream
Constructor. -
SimpleCharStream
public SimpleCharStream(InputStream dstream, String encoding, int startline, int startcolumn, int buffersize) throws UnsupportedEncodingException Constructor.- Throws:
UnsupportedEncodingException
-
SimpleCharStream
public SimpleCharStream(InputStream dstream, String encoding, int startline, int startcolumn) throws UnsupportedEncodingException Constructor.- Throws:
UnsupportedEncodingException
-
SimpleCharStream
Constructor.- Throws:
UnsupportedEncodingException
-
-
Method Details
-
reInit
Reinitialise. -
reInit
Reinitialise. -
reInit
Reinitialise. -
reInit
Reinitialise.- Throws:
UnsupportedEncodingException
-
reInit
public void reInit(InputStream dstream, String encoding, int startline, int startcolumn) throws UnsupportedEncodingException Reinitialise.- Throws:
UnsupportedEncodingException
-
reInit
public void reInit(InputStream dstream, String encoding, int startline, int startcolumn, int buffersize) throws UnsupportedEncodingException Reinitialise.- Throws:
UnsupportedEncodingException
-
streamRead
Description copied from class:AbstractCharStream
Read from the underlying stream.- Specified by:
streamRead
in classAbstractCharStream
- Parameters:
aBuf
- the buffer to be fillednOfs
- The offset into the buffer. 0-basednLen
- Number of chars to read.- Returns:
- Number of effective chars read, or -1 on error.
- Throws:
IOException
-
streamClose
Description copied from class:AbstractCharStream
Close the underlying stream.- Specified by:
streamClose
in classAbstractCharStream
- Throws:
IOException
- If closing fails.
-