Android
java.io
public abstract class

java.io.FilterWriter

java.lang.Object
java.io.Writer Closeable Flushable Appendable
java.io.FilterWriter

FilterWriter is a class which takes a Writer and filters the output in some way. The filtered view may be a buffered output or one which compresses data before actually writing the bytes.

See Also

Summary

Fields

protected      Writer  out  The Writer being filtered. 
Fields inherited from class java.io.Writer

Protected Constructors

            FilterWriter(Writer out)
Constructs a new FilterWriter on the Writer out.

Public Methods

          void  close()
Close this FilterWriter.
          void  flush()
Flush this FilteredWriter to ensure all pending data is sent out to the target Writer.
          void  write(char[] buffer, int offset, int count)
Writes count chars from the char array buffer starting at offset index to this FilterWriter.
          void  write(String str, int offset, int count)
Writes count chars from the String str starting at offset index to this FilterWriter.
          void  write(int oneChar)
Writes the specified char oneChar to this FilterWriter.
Methods inherited from class java.io.Writer
Methods inherited from class java.lang.Object
Methods inherited from interface java.io.Closeable
Methods inherited from interface java.io.Flushable
Methods inherited from interface java.lang.Appendable

Details

Fields

protected Writer out

The Writer being filtered.

Protected Constructors

protected FilterWriter(Writer out)

Constructs a new FilterWriter on the Writer out. All writes are now filtered through this Writer.

Parameters

out the target Writer to filter writes on.

Public Methods

public void close()

Close this FilterWriter. Closes the Writer out by default. This will close any downstream Writers as well. Any additional processing required by concrete subclasses should be provided in their own close implementation.

Throws

IOException If an error occurs attempting to close this FilterWriter.

public void flush()

Flush this FilteredWriter to ensure all pending data is sent out to the target Writer. This implementation flushes the target Writer.

Throws

IOException If an error occurs attempting to flush this FilterWriter.

public void write(char[] buffer, int offset, int count)

Writes count chars from the char array buffer starting at offset index to this FilterWriter. This implementation writes the buffer to the target Writer.

Parameters

buffer the buffer to be written
offset offset in buffer to get chars
count number of chars in buffer to write

Throws

IOException If an error occurs attempting to write to this FilterWriter.

public void write(String str, int offset, int count)

Writes count chars from the String str starting at offset index to this FilterWriter. This implementation writes the str to the target Writer.

Parameters

str the String to be written.
offset offset in str to get chars.
count number of chars in str to write.

Throws

IOException If an error occurs attempting to write to this FilterWriter.

public void write(int oneChar)

Writes the specified char oneChar to this FilterWriter. Only the 2 low order bytes of oneChar is written. This implementation writes the char to the target Writer.

Parameters

oneChar the char to be written

Throws

IOException If an error occurs attempting to write to this FilterWriter.
Copyright 2007 Google Inc. Build 0.9_r1-98467 - 14 Aug 2008 18:48