CharArrayReader

public class CharArrayReader extends Reader

This class implements a character buffer that can be used as a character-input stream.

Field Summary

protected char[] buf The character buffer.
protected int count The index of the end of this buffer.
protected int markedPos The position of mark in buffer.
protected int pos The current buffer position.

Inherited Field Summary

Public Constructor Summary

CharArrayReader(char[] buf)
Creates a CharArrayReader from the specified array of chars.
CharArrayReader(char[] buf, int offset, int length)
Creates a CharArrayReader from the specified array of chars.

Public Method Summary

void
close()
Closes the stream and releases any system resources associated with it.
void
mark(int readAheadLimit)
Marks the present position in the stream.
boolean
markSupported()
Tells whether this stream supports the mark() operation, which it does.
int
read()
Reads a single character.
int
read(char[] b, int off, int len)
Reads characters into a portion of an array.
boolean
ready()
Tells whether this stream is ready to be read.
void
reset()
Resets the stream to the most recent mark, or to the beginning if it has never been marked.
long
skip(long n)
Skips characters.

Inherited Method Summary

Fields

protected char[] buf

The character buffer.