public class LAReader
extends java.io.Reader
LAStreamTokenizer| Constructor and Description |
|---|
LAReader(java.io.Reader reader)
Constructs a LAReader with the specified Reader.
|
LAReader(java.io.Reader reader,
int size)
Constructs a LAReader with the specified Reader
and buffer size.
|
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Closes this LAReader.
|
java.lang.String |
lookahead()
Returns a lookahead string of length equal to the buffer's.
|
java.lang.String |
lookahead(int n)
Returns the string of the n characters to be read next.
|
void |
mark(int readAheadLimit)
This method does nothing because marking is not supported.
|
boolean |
markSupported()
Returns false because it there is no simple way to
accommodate marking with the lookahead buffer.
|
int |
read()
Consumes and returns the next character in the LAReader.
|
int |
read(char[] cbuf)
Read characters into an array.
|
int |
read(char[] cbuf,
int off,
int len)
Read characters into a portion of an array.
|
boolean |
ready()
Returns true iff there is a character available to
be read.
|
void |
reset()
This method does nothing because marking is not supported.
|
void |
resizeBuffer(int size)
Resizes the lookahead buffer to the specified size.
|
long |
skip(long n)
Skip n characters, up to EOF (or, more generally,
any negative value returned by read()).
|
java.lang.String |
toString()
Returns a string describing the current buffer state.
|
public LAReader(java.io.Reader reader)
public LAReader(java.io.Reader reader,
int size)
public final int read()
throws java.io.IOException
read in class java.io.Readerjava.io.IOExceptionpublic final java.lang.String lookahead(int n)
throws java.io.IOException
java.io.IOExceptionpublic final java.lang.String lookahead()
throws java.io.IOException
java.io.IOExceptionpublic void resizeBuffer(int size)
throws java.io.IOException
java.io.IOExceptionpublic void close()
throws java.io.IOException
close in interface java.io.Closeableclose in interface java.lang.AutoCloseableclose in class java.io.Readerjava.io.IOExceptionpublic java.lang.String toString()
toString in class java.lang.Objectpublic int read(char[] cbuf,
int off,
int len)
throws java.io.IOException
read in class java.io.Readercbuf - Destination bufferoff - Offset at which to start storing characterslen - Maximum number of characters to readjava.io.IOException - If an I/O error occurspublic int read(char[] cbuf)
throws java.io.IOException
read in class java.io.Readercbuf - Destination bufferjava.io.IOException - If an I/O error occurspublic long skip(long n)
throws java.io.IOException
skip in class java.io.Readern - The number of characters to skipjava.lang.IllegalArgumentException - If n is negativejava.io.IOException - If an I/O error occurspublic boolean ready()
throws java.io.IOException
ready in class java.io.Readerjava.io.IOExceptionpublic boolean markSupported()
markSupported in class java.io.Readerpublic void mark(int readAheadLimit)
throws java.io.IOException
mark in class java.io.Readerjava.io.IOExceptionpublic void reset()
throws java.io.IOException
reset in class java.io.Readerjava.io.IOException