Package org.lionsoul.jcseg.util
Class IPushbackReader
- java.lang.Object
-
- org.lionsoul.jcseg.util.IPushbackReader
-
public class IPushbackReader extends Object
IPushBackReader based on Reader Not thread safe support unlimited unread operation- Author:
- chenxin
-
-
Constructor Summary
Constructors Constructor Description IPushbackReader(Reader reader)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intgetQueueSize()get the buffer size - the number of buffered dataintread()read the next int from the stream this will check the buffer queue first and take the first item of the buffer as the resultintread(char[] cbuf, int off, int len)read the specified block from the streamvoidunread(char[] cbuf, int off, int len)unread a block from a char array to the streamvoidunread(int data)unread the specified data to the stream push the data back to the queue in fact, you know
-
-
-
Constructor Detail
-
IPushbackReader
public IPushbackReader(Reader reader)
-
-
Method Detail
-
read
public int read() throws IOExceptionread the next int from the stream this will check the buffer queue first and take the first item of the buffer as the result- Returns:
- int
- Throws:
IOException
-
read
public int read(char[] cbuf, int off, int len) throws IOExceptionread the specified block from the stream- Returns:
- int
- Throws:
IOException- See Also:
read()
-
unread
public void unread(int data)
unread the specified data to the stream push the data back to the queue in fact, you know
-
getQueueSize
public int getQueueSize()
get the buffer size - the number of buffered data- Returns:
- int
-
unread
public void unread(char[] cbuf, int off, int len)unread a block from a char array to the stream- See Also:
unread(int)
-
-