Name

StringBufferInputStream

Synopsis

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.

java.io.StringBufferInputStream

Figure 9-58. java.io.StringBufferInputStream

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;  
}

Get Java in a Nutshell, 5th Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.