is new.
java.lang.Objectjava.io.Reader
java.io.CharArrayReader
public class CharArrayReader
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. |
| Fields inherited from class java.io. Reader |
|---|
| lock |
| Constructor Summary | |
|---|---|
CharArrayReader
(char[] buf)
Creates a
|
|
CharArrayReader
(char[] buf, int offset, int length)
Creates a
|
|
| Method Summary | |
|---|---|
| void |
close
()
Closes
stream and releases any system resources associated with it.
|
| void |
mark
(int readAheadLimit)
Marks
|
| boolean |
markSupported
()
Tells
|
| int |
read
()
Reads
|
| int |
read
(char[] b, int off, int len)
Reads
|
| boolean |
ready
()
Tells
|
| void |
reset
()
Resets
|
| long |
skip
(long n)
Skips
|
| Methods inherited from class java.io. Reader |
|---|
| read , read |
| Methods inherited from class java.lang. Object |
|---|
| clone , equals , finalize , getClass , hashCode , notify , notifyAll , toString , wait , wait , wait |
| Field Detail |
|---|
protected char[] buf
protected int pos
protected int markedPos
protected int count
| Constructor Detail |
|---|
public CharArrayReader(char[] buf)
Creates a
public CharArrayReader(char[] buf,
int offset,
int length)
Creates a
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.
| Method Detail |
|---|
public int read()
throws IOException
Reads
public int read(char[] b,
int off,
int len)
throws IOException
Reads
public long skip(long n)
throws IOException
Skips
The n parameter may be negative, even though the skip method of the Reader superclass throws an exception in this case. If n is negative, then this method does nothing and returns 0.
public boolean ready()
throws IOException
Tells
public boolean markSupported()
Tells
public void mark(int readAheadLimit)
throws IOException
Marks
public void reset()
throws IOException
Resets
public void close()
Closes the stream and releases any system resources associated with it. Once the stream has been closed, further read(), ready(), mark(), reset(), or skip() invocations will throw an IOException. Closing a previously closed stream has no effect.