Latin1Readerpublic class Latin1Reader extends Reader Reader for the ISO-8859-1 encoding. |
Fields Summary |
---|
public static final int | DEFAULT_BUFFER_SIZEDefault byte buffer size (2048). | protected final InputStream | fInputStreamInput stream. | protected final byte[] | fBufferByte buffer. |
Constructors Summary |
---|
public Latin1Reader(InputStream inputStream)Constructs an ISO-8859-1 reader from the specified input stream
using the default buffer size.
//
// Constructors
//
this(inputStream, DEFAULT_BUFFER_SIZE);
| public Latin1Reader(InputStream inputStream, int size)Constructs an ISO-8859-1 reader from the specified input stream
and buffer size.
this(inputStream, new byte[size]);
| public Latin1Reader(InputStream inputStream, byte[] buffer)Constructs an ISO-8859-1 reader from the specified input stream and buffer.
fInputStream = inputStream;
fBuffer = buffer;
|
Methods Summary |
---|
public void | close()Close the stream. Once a stream has been closed, further read(),
ready(), mark(), or reset() invocations will throw an IOException.
Closing a previously-closed stream, however, has no effect.
fInputStream.close();
| public void | mark(int readAheadLimit)Mark the present position in the stream. Subsequent calls to reset()
will attempt to reposition the stream to this point. Not all
character-input streams support the mark() operation.
fInputStream.mark(readAheadLimit);
| public boolean | markSupported()Tell whether this stream supports the mark() operation.
return fInputStream.markSupported();
| public int | read()Read a single character. This method will block until a character is
available, an I/O error occurs, or the end of the stream is reached.
Subclasses that intend to support efficient single-character input
should override this method.
return fInputStream.read();
| public int | read(char[] ch, int offset, int length)Read characters into a portion of an array. This method will block
until some input is available, an I/O error occurs, or the end of the
stream is reached.
if (length > fBuffer.length) {
length = fBuffer.length;
}
int count = fInputStream.read(fBuffer, 0, length);
for (int i = 0; i < count; ++i) {
ch[offset + i] = (char) (fBuffer[i] & 0xff);
}
return count;
| public boolean | ready()Tell whether this stream is ready to be read.
return false;
| public void | reset()Reset the stream. If the stream has been marked, then attempt to
reposition it at the mark. If the stream has not been marked, then
attempt to reset it in some way appropriate to the particular stream,
for example by repositioning it to its starting point. Not all
character-input streams support the reset() operation, and some support
reset() without supporting mark().
fInputStream.reset();
| public long | skip(long n)Skip characters. This method will block until some characters are
available, an I/O error occurs, or the end of the stream is reached.
return fInputStream.skip(n);
|
|