Save This Page
Home » apache-harmony-6.0-src-r917296-snapshot » java » io » [javadoc | source]
java.io
public class: StringBufferInputStream [javadoc | source]
java.lang.Object
   java.io.InputStream
      java.io.StringBufferInputStream

All Implemented Interfaces:
    Closeable

Deprecated! Use - StringReader

A specialized InputStream that reads bytes from a {@code String} in a sequential manner.
Field Summary
protected  String buffer    The source string containing the data to read. 
protected  int count    The total number of characters in the source string. 
protected  int pos    The current position within the source string. 
Constructor:
 public StringBufferInputStream(String str) 
    Construct a new {@code StringBufferInputStream} with {@code str} as source. The size of the stream is set to the {@code length()} of the string.
    Parameters:
    str - the source string for this stream.
    Throws:
    NullPointerException - if {@code str} is {@code null}.
Method from java.io.StringBufferInputStream Summary:
available,   read,   read,   reset,   skip
Methods from java.io.InputStream:
available,   close,   mark,   markSupported,   read,   read,   read,   reset,   skip
Methods from java.lang.Object:
clone,   equals,   finalize,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from java.io.StringBufferInputStream Detail:
 public synchronized int available() 
      Deprecated!
    Returns the number of bytes that are available before this stream will block.
 public synchronized int read() 
      Deprecated!
    Reads a single byte from the source string and returns it as an integer in the range from 0 to 255. Returns -1 if the end of the source string has been reached.
 public synchronized int read(byte[] b,
    int offset,
    int length) 
      Deprecated!
    Reads at most {@code length} bytes from the source string and stores them in the byte array {@code b} starting at {@code offset}.
 public synchronized  void reset() 
      Deprecated!
    Resets this stream to the beginning of the source string.
 public synchronized long skip(long n) 
      Deprecated!
    Skips {@code n} characters in the source string. It does nothing and returns 0 if {@code n} is negative. Less than {@code n} characters are skipped if the end of the source string is reached before the operation completes.