Build 1.1_r1 (from source)

java.io
Class StringBufferInputStream

java.lang.Object
  extended by java.io.InputStream
      extended by java.io.StringBufferInputStream
All Implemented Interfaces:
Closeable

Deprecated. Use StringReader

@Deprecated
public class StringBufferInputStream
extends InputStream

A specialized InputStream that reads bytes from a String in a sequential manner.

Since:
Android 1.0

Field Summary
protected  String buffer
          Deprecated. The source string containing the data to read.
protected  int count
          Deprecated. The total number of characters in the source string.
protected  int pos
          Deprecated. The current position within the source string.
 
Constructor Summary
StringBufferInputStream(String str)
          Deprecated. Construct a new StringBufferInputStream with str as source.
 
Method Summary
 int available()
          Deprecated. Returns the number of bytes that are available before this stream will block.
 int read()
          Deprecated. Reads a single byte from the source string and returns it as an integer in the range from 0 to 255.
 int read(byte[] b, int offset, int length)
          Deprecated. Reads at most length bytes from the source string and stores them in the byte array b starting at offset.
 void reset()
          Deprecated. Resets this stream to the beginning of the source string.
 long skip(long n)
          Deprecated. Skips n characters in the source string.
 
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

buffer

protected String buffer
Deprecated. 
The source string containing the data to read.

Since:
Android 1.0

count

protected int count
Deprecated. 
The total number of characters in the source string.

Since:
Android 1.0

pos

protected int pos
Deprecated. 
The current position within the source string.

Since:
Android 1.0
Constructor Detail

StringBufferInputStream

public StringBufferInputStream(String str)
Deprecated. 
Construct a new StringBufferInputStream with str as source. The size of the stream is set to the length() of the string.

Parameters:
str - the source string for this stream.
Throws:
NullPointerException - if str is null.
Since:
Android 1.0
Method Detail

available

public int available()
Deprecated. 
Returns the number of bytes that are available before this stream will block.

Overrides:
available in class InputStream
Returns:
the number of bytes available before blocking.
Since:
Android 1.0

read

public 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.

Specified by:
read in class InputStream
Returns:
the byte read or -1 if the end of the source string has been reached.
Since:
Android 1.0

read

public int read(byte[] b,
                int offset,
                int length)
Deprecated. 
Reads at most length bytes from the source string and stores them in the byte array b starting at offset.

Overrides:
read in class InputStream
Parameters:
b - the byte array in which to store the bytes read.
offset - the initial position in b to store the bytes read from this stream.
length - the maximum number of bytes to store in b.
Returns:
the number of bytes actually read or -1 if the end of the source string has been reached.
Throws:
IndexOutOfBoundsException - if offset < 0 or length < 0, or if offset + length is greater than the length of b.
NullPointerException - if b is null.
Since:
Android 1.0

reset

public void reset()
Deprecated. 
Resets this stream to the beginning of the source string.

Overrides:
reset in class InputStream
Since:
Android 1.0

skip

public long skip(long n)
Deprecated. 
Skips n characters in the source string. It does nothing and returns 0 if n is negative. Less than n characters are skipped if the end of the source string is reached before the operation completes.

Overrides:
skip in class InputStream
Parameters:
n - the number of characters to skip.
Returns:
the number of characters actually skipped.
Since:
Android 1.0

Build 1.1_r1 (from source)

Please submit a feedback, bug or feature