org.apache.jasper.xmlparser
public class UCSReader extends Reader
Version: $Id: UCSReader.java 467222 2006-10-24 03:17:11Z markt $
Field Summary | |
---|---|
static int | DEFAULT_BUFFER_SIZE Default byte buffer size (8192, larger than that of ASCIIReader
since it's reasonable to surmise that the average UCS-4-encoded
file should be 4 times as large as the average ASCII-encoded file). |
protected byte[] | fBuffer Byte buffer. |
protected short | fEncoding |
protected InputStream | fInputStream Input stream. |
static short | UCS2BE |
static short | UCS2LE |
static short | UCS4BE |
static short | UCS4LE |
Constructor Summary | |
---|---|
UCSReader(InputStream inputStream, short encoding)
Constructs an ASCII reader from the specified input stream
using the default buffer size. | |
UCSReader(InputStream inputStream, int size, short encoding)
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. encoding One of UCS2LE, UCS2BE, UCS4LE or UCS4BE.
Parameters: inputStream The input stream. size The initial buffer size. encoding One of UCS2LE, UCS2BE, UCS4LE or UCS4BE.
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