StringReader


StringReader java.io

Java 1.1 readable 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. java.io.StringReader

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



Java In A Nutshell
Java In A Nutshell, 5th Edition
ISBN: 0596007736
EAN: 2147483647
Year: 2004
Pages: 1220

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net