Team LiB
Previous Section Next Section

Java 1.1readable closeable

This class is a character input stream that uses a String object as the source of the characters it returns. When you create a StringReader, you must specify the String to read from. StringReader defines the normal Reader methods and supports mark( ) and reset( ). If reset( ) is called before mark( ) has been called, the stream is reset to the beginning of the specified string. StringReader is a character stream analog to StringBufferInputStream, which is deprecated as of Java 1.1. StringReader is also similar to CharArrayReader.

Figure 9-59.

public class StringReader extends Reader {
// Public Constructors
     public StringReader(String s);  
// Public Methods Overriding Reader
     public void close( );  
     public void mark(int readAheadLimit) throws IOException;  
     public boolean markSupported( );                                     constant
     public int read( ) throws IOException;  
     public int read(char[ ] cbuf, int off, int len) throws IOException;  
     public boolean ready( ) throws IOException;  
     public void reset( ) throws IOException;  
     public long skip(long ns) throws IOException;  

    Team LiB
    Previous Section Next Section