|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.io.InputStream java.io.FilterInputStream org.yajul.io.AbstractByteFilterInputStream org.yajul.io.TokenizingInputStream
public class TokenizingInputStream
Reads from the underlying input stream until the delimiter is reached. The read methods will return -1 (end of stream) when the delimiter is reached, or the end of the underlying stream has been reached. User: josh Date: Jan 18, 2004 Time: 10:00:01 AM
Field Summary |
---|
Fields inherited from class java.io.FilterInputStream |
---|
in |
Constructor Summary | |
---|---|
TokenizingInputStream(java.io.InputStream in,
byte[] delimiter)
Creates a FilterInputStream
by assigning the argument in
to the field this.in so as
to remember it for later use. |
Method Summary | |
---|---|
boolean |
endOfStream()
Returns true if the end of the underlying stream was encountered. |
int |
getTokenCount()
Returns the number of tokens matched so far. |
boolean |
nextToken()
Resets the stream so a new token can be read. |
int |
read()
Reads the next byte of data from this input stream. |
Methods inherited from class org.yajul.io.AbstractByteFilterInputStream |
---|
insert, read, readByte |
Methods inherited from class java.io.FilterInputStream |
---|
available, close, mark, markSupported, read, reset, skip |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public TokenizingInputStream(java.io.InputStream in, byte[] delimiter)
FilterInputStream
by assigning the argument in
to the field this.in
so as
to remember it for later use.
delimiter
- the delimiterin
- the underlying input stream, or null
if
this instance is to be created without an underlying stream.Method Detail |
---|
public int read() throws java.io.IOException
int
in the range
0
to 255
. If no byte is available
because the end of the stream has been reached, the value
-1
is returned. This method blocks until input data
is available, the end of the stream is detected, or an exception
is thrown.
This method
simply performs in.read()
and returns the result.
read
in class AbstractByteFilterInputStream
-1
if the end of the
stream is reached.
java.io.IOException
- if an I/O error occurs.FilterInputStream.in
public boolean endOfStream()
public boolean nextToken()
public int getTokenCount()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |