Class: java.io.CharArrayReader
- public class CharArrayReader
- extends Reader
This class implements a character buffer that can be used as a
character-input stream.
Methods
-
CharArrayReadertop
public CharArrayReader(char[] buf)Create an CharArrayReader from the specified array of chars. -
CharArrayReadertop
public CharArrayReader(char[] buf, int offset, int length)Create an CharArrayReader from the specified array of chars.The resulting reader will start reading at the given offset. The total number of char values that can be read from this reader will be either length or buf.length-offset, whichever is smaller.
-
closetop
public void close()Close the stream. -
marktop
public void mark(int readAheadLimit) throws IOExceptionMark the present position in the stream. Subsequent calls to reset() will reposition the stream to this point. -
markSupportedtop
public boolean markSupported()Tell whether this stream supports the mark() operation, which it does.- Override hierarchy:
- markSupported from Reader
-
readtop
public int read() throws IOExceptionRead a single character. -
readtop
public int read(char[] b, int off, int len) throws IOExceptionRead characters into a portion of an array. -
readytop
public boolean ready() throws IOExceptionTell whether this stream is ready to be read. Character-array readers are always ready to be read. -
resettop
public void reset() throws IOExceptionReset the stream to the most recent mark, or to the beginning if it has never been marked. -
skiptop
public long skip(long n) throws IOExceptionSkip characters. Returns the number of characters that were skipped.The
nparameter may be negative, even though theskipmethod of the java.io.Reader superclass throws an exception in this case. Ifnis negative, then this method does nothing and returns0.
