org.apache.jasper.xmlparser
public class ASCIIReader extends Reader
Version: $Id: ASCIIReader.java 708125 2008-10-27 10:10:13Z markt $
Field Summary | |
---|---|
static int | DEFAULT_BUFFER_SIZE Default byte buffer size (2048). |
protected byte[] | fBuffer Byte buffer. |
protected InputStream | fInputStream Input stream. |
Constructor Summary | |
---|---|
ASCIIReader(InputStream inputStream, int size)
Constructs an ASCII reader from the specified input stream
and buffer size.
|
Method Summary | |
---|---|
void | close()
Close the stream. |
void | mark(int readAheadLimit)
Mark the present position in the stream. |
boolean | markSupported()
Tell whether this stream supports the mark() operation. |
int | read()
Read a single character. |
int | read(char[] ch, int offset, int length)
Read characters into a portion of an array. |
boolean | ready()
Tell whether this stream is ready to be read.
|
void | reset()
Reset the stream. |
long | skip(long n)
Skip characters. |
Parameters: inputStream The input stream. size The initial buffer size.
Throws: IOException If an I/O error occurs
Parameters: readAheadLimit Limit on the number of characters that may be read while still preserving the mark. After reading this many characters, attempting to reset the stream may fail.
Throws: IOException If the stream does not support mark(), or if some other I/O error occurs
Subclasses that intend to support efficient single-character input should override this method.
Returns: The character read, as an integer in the range 0 to 127 (0x00-0x7f), or -1 if the end of the stream has been reached
Throws: IOException If an I/O error occurs
Parameters: ch Destination buffer offset Offset at which to start storing characters length Maximum number of characters to read
Returns: The number of characters read, or -1 if the end of the stream has been reached
Throws: IOException If an I/O error occurs
Returns: True if the next read() is guaranteed not to block for input, false otherwise. Note that returning false does not guarantee that the next read will block.
Throws: IOException If an I/O error occurs
Throws: IOException If the stream has not been marked, or if the mark has been invalidated, or if the stream does not support reset(), or if some other I/O error occurs
Parameters: n The number of characters to skip
Returns: The number of characters actually skipped
Throws: IOException If an I/O error occurs