Class java.io.InputStreamStringBuffer
All Packages    This Package    Previous    Next

Class java.io.InputStreamStringBuffer

java.lang.Object
   |
   +----java.io.InputStream
           |
           +----java.io.InputStreamStringBuffer

public class InputStreamStringBuffer
extends InputStream
This class implements a String buffer that can be used as an InputStream.
Version:
1.11, 31 Jan 1995
Author:
Arthur van Hoff

count
The number of characters to use in the buffer.
pos
The position in the buffer.

InputStreamStringBuffer(String)
Creates an InputStreamStringBuffer, given an array of bytes.

available()
Returns the number of available bytes in the buffer.
read()
Reads a byte.
read(byte[], int, int)
Reads into an array of bytes.
reset()
Resets the buffer to the beginning.
skip(int)
Skips bytes of input.

pos
  protected int pos
The position in the buffer.
count
  protected int count
The number of characters to use in the buffer.

InputStreamStringBuffer
  public InputStreamStringBuffer(String s)
Creates an InputStreamStringBuffer, given an array of bytes.
Parameters:
buf - the input buffer (not copied)

read
  public synchronized int read()
Reads a byte.
Returns:
the byte read, or -1 if the end of the stream is reached.
Overrides:
read in class InputStream

read

  public synchronized int read(byte b[],
                               int off,
                               int len)
Reads into an array of bytes. For efficiency, this method should be overridden in a subclass (the default implementation reads 1 byte at a time).
Parameters:
b - the buffer into which the data is read
off - the start offset of the data
len - the maximum number of bytes read
Returns:
the actual number of bytes read; -1 is returned when the end of the stream is reached.
Overrides:
read in class InputStream

skip

  public synchronized int skip(int n)
Skips bytes of input.
Parameters:
n - bytes to be skipped
Returns:
actual number of bytes skipped
Overrides:
skip in class InputStream

available

  public synchronized int available()
Returns the number of available bytes in the buffer.
Returns:
the number of available bytes
Overrides:
available in class InputStream

reset

  public synchronized void reset()
Resets the buffer to the beginning.
Overrides:
reset in class InputStream


All Packages    This Package    Previous    Next