All Packages Class Hierarchy This Package Previous Next Index
java.lang.Object
|
+----java.io.InputStream
|
+----java.io.StringBufferInputStream
StringReader
class.
This class allows an application to create an input stream in
which the bytes read are supplied by the contents of a string.
Applications can also read bytes from a byte array by using a
ByteArrayInputStream
.
Only the low eight bits of each character in the string are used by this class.
len
bytes of data from this input stream
into an array of bytes.
n
bytes of input from this input stream.
protected String buffer
protected int pos
protected int count
public StringBufferInputStream(String s)
public synchronized int read()
int
in the range
0
to 255
. If no byte is available
because the end of the stream has been reached, the value
-1
is returned.
The read
method of
StringBufferInputStream
cannot block. It returns the
low eight bits of the next character in this input stream's buffer.
-1
if the end of the
stream is reached.
public synchronized int read(byte b[],
int off,
int len)
len
bytes of data from this input stream
into an array of bytes.
The read
method of
StringBufferInputStream
cannot block. It copies the
low eight bits from the characters in this input stream's buffer into
the byte array argument.
-1
if there is no more data because the end of
the stream has been reached.
public synchronized long skip(long n)
n
bytes of input from this input stream. Fewer
bytes might be skipped if the end of the input stream is reached.
public synchronized int available()
count - pos
, which is the
number of bytes remaining to be read from the input buffer.
public synchronized void reset()
All Packages Class Hierarchy This Package Previous Next Index