Team LiB
Previous Section Next Section

Java 1.0; Deprecated in 1.1@Deprecated closeable

This class is a subclass of InputStream in which input bytes come from the characters of a specified String object. This class does not correctly convert the characters of a StringBuffer into bytes and is deprecated as of Java 1.1. Use StringReader instead to convert characters into bytes or use ByteArrayInputStream to read bytes from an array of bytes.

Figure 9-58.

public class StringBufferInputStream extends InputStream {
// Public Constructors
     public StringBufferInputStream(String s);  
// Public Methods Overriding InputStream
     public int available( );                              synchronized
     public int read( );                                   synchronized
     public int read(byte[ ] b, int off, int len);               synchronized
     public void reset( );                                 synchronized
     public long skip(long n);                           synchronized
// Protected Instance Fields
     protected String buffer;  
     protected int count;  
     protected int pos;  

    Team LiB
    Previous Section Next Section