Deprecated
This class does not properly convert characters into bytes. As
of JDK 1.1, the preferred way to create a stream from a
string is via the StringReader class.
ByteArrayInputStream.
Only the low eight bits of each character in the string are used by this class.
java.io.ByteArrayInputStream , java.io.StringReader
| Modifier and Type | Field and Description |
|---|---|
| protected String | buffer
The string from which bytes are read. |
| protected int | count
The number of valid characters in the input stream buffer. |
| protected int | pos
The index of the next character to read from the input stream buffer. |
| Access | Constructor and Description |
|---|---|
| public | StringBufferInputStream(String
the underlying input buffer. s)Creates a string input stream to read data from the specified string. |
| Modifier and Type | Method and Description |
|---|---|
| public synchronized int | Returns: the value ofcount - pos, which is the
number of bytes remaining to be read from the input buffer.Overrides java. Returns the number of bytes that can be read from the input stream without blocking. |
| public synchronized int | read()
Implements abstract java. Reads the next byte of data from this input stream. |
| public synchronized int | read(byte[] b, int off, int len)
Overrides java. Reads up to |
| public synchronized void | reset()
Overrides java. Resets the input stream to begin reading from the first character of this input stream's underlying buffer. |
| public synchronized long | Returns: the actual number of bytes skipped.Overrides java. Skips |
| buffer | back to summary |
|---|---|
| protected String buffer The string from which bytes are read. | |
| count | back to summary |
|---|---|
| protected int count The number of valid characters in the input stream buffer. | |
| pos | back to summary |
|---|---|
| protected int pos The index of the next character to read from the input stream buffer. | |
| StringBufferInputStream | back to summary |
|---|---|
| public StringBufferInputStream(String s) Creates a string input stream to read data from the specified string.
| |
| available | back to summary |
|---|---|
| public synchronized int available() Overrides java. Returns the number of bytes that can be read from the input stream without blocking.
| |
| read | back to summary |
|---|---|
| public synchronized int read() Implements abstract java. Reads the next byte of data from this input stream. The value
byte is returned as an Implementation Specification The
| |
| read | back to summary |
|---|---|
| public synchronized int read(byte[] b, int off, int len) Overrides java. Reads up to Implementation Specification The
| |
| reset | back to summary |
|---|---|
| public synchronized void reset() Overrides java. Resets the input stream to begin reading from the first character of this input stream's underlying buffer.
| |
| skip | back to summary |
|---|---|
| public synchronized long skip(long n) Overrides java. Skips
| |