Class Reader

lang/Object.html">java.lang.Object
  extended by java.io.Reader
All Implemented Interfaces: 
Closeable, Readable
Direct Known Subclasses:
BufferedReader, CharArrayReader, FilterReader, InputStreamReader, PipedReader, StringReader

public abstract class Reader
Object
implements Readable, Closeable

Abstract class for reading character streams. The only methods that a subclass must implement are read(char[], int, int) and close(). Most subclasses, however, will override some of the methods defined here in order to provide higher efficiency, additional functionality, or both.

Since:
JDK1.1
See Also:
BufferedReader, LineNumberReader, CharArrayReader, InputStreamReader, FileReader, FilterReader, PushbackReader, PipedReader, StringReader, Writer

Field Summary
Object Reader.html#lock"> lock
          The object used to synchronize operations on this stream.
 
Constructor Summary
protected Reader.html#Reader()"> Reader()
          Creates a new character-stream reader whose critical sections will synchronize on the reader itself.
protected Reader.html#Reader(java.lang.Object)"> Reader(lang/Object.html">Object lock)
          Creates a new character-stream reader whose critical sections will synchronize on the given object.
 
Method Summary
abstract  void  close()
          Closes the stream and releases any system resources associated with it.
 void  mark(int readAheadLimit)
          Marks the present position in the stream.
 boolean  markSupported()
          Tells whether this stream supports the mark() operation.
 int  read()
          Reads a single character.
 int  read(char[] cbuf)
          Reads characters into an array.
abstract  int  read(char[] cbuf, int off, int len)
          Reads characters into a portion of an array.
 int Reader.html#read(java.nio.CharBuffer)"> read(CharBuffer target)
          Attempts to read characters into the specified character buffer.
 boolean Reader.html#ready()"> ready()
          Tells whether this stream is ready to be read.
 void Reader.html#reset()"> reset()
          Resets the stream.
 long Reader.html#skip(long)"> skip(long n)
          Skips characters.

Class Writer

lang/Object.html">java.lang.Object
  extended by java.io.Writer
All Implemented Interfaces:
Closeable, Flushable, Appendable
Direct Known Subclasses:
BufferedWriter, CharArrayWriter, FilterWriter, OutputStreamWriter, PipedWriter, PrintWriter, StringWriter

 
public abstract class Writer
extends lang/Object.html"> Object
implements Appendable, Closeable, Flushable
 

Abstract class for writing to character streams. The only methods that a subclass must implement are write(char[], int, int), flush(), and close(). Most subclasses, however, will override some of the methods defined here in order to provide higher efficiency, additional functionality, or both.

 

 

Since:
JDK1.1
See Also:
Writer, BufferedWriter, CharArrayWriter, FilterWriter, OutputStreamWriter, FileWriter, PipedWriter, PrintWriter, StringWriter, Reader

 

Field Summary
Object  lock
          The object used to synchronize operations on this stream.
 
Constructor Summary
protected Writer()
          Creates a new character-stream writer whose critical sections will synchronize on the writer itself.
protected  Writer(lang/Object.html">Object lock)
          Creates a new character-stream writer whose critical sections will synchronize on the given object.
 
Method Summary
   
 Writer  append(CharSequence csq)
          Appends the specified character sequence to this writer.
 Writer  append(CharSequence csq, int start, int end)
          Appends a subsequence of the specified character sequence to this writer.
abstract  void  close()
          Closes the stream, flushing it first.
abstract  void Writer.html#flush()"> flush()
          Flushes the stream.
 void Writer.html#write(char[])"> write(char[] cbuf)
          Writes an array of characters.
abstract  void  write(char[] cbuf, int off, int len)
          Writes a portion of an array of characters.
 void  write(int c)
          Writes a single character.
 void  write(lang/String.html">String str)
          Writes a string.
 void  write(lang/String.html">String str, int off, int len)
          Writes a portion of a string.
 
Methods inherited from class java.lang.lang/Object.html">Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait