|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.io.InputStream | +--java.io.StringBufferInputStream
This class implements a String buffer that can be used as an InputStream.
Field Summary | |
protected String |
buffer
The buffer where data is stored. |
protected int |
count
The number of characters to use in the buffer. |
protected int |
pos
The position in the buffer. |
Constructor Summary | |
StringBufferInputStream(String s)
Creates an StringBufferInputStream from the specified array of bytes. |
Method Summary | |
int |
available()
Returns the number of available bytes in the buffer. |
int |
read()
Reads a byte of data. |
int |
read(byte[] b,
int off,
int len)
Reads into an array of bytes. |
void |
reset()
Resets the buffer to the beginning. |
long |
skip(long n)
Skips n bytes of input. |
Methods inherited from class java.io.InputStream |
close, mark, markSupported, read |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected String buffer
protected int pos
protected int count
Constructor Detail |
public StringBufferInputStream(String s)
s
- the input buffer (not copied)Method Detail |
public int read()
read
in class InputStream
public int read(byte[] b, int off, int len)
read
in class InputStream
b
- the buffer into which the data is readoff
- the start offset of the datalen
- the maximum number of bytes read
public long skip(long n)
skip
in class InputStream
n
- the number of bytes to be skipped
public int available()
available
in class InputStream
public void reset()
reset
in class InputStream
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |