Monday 11 March 2013

java.io Writer


java.io
Writer

Declaration
public abstract class Writer
java.lang.Object
|
+--java.io.Writer
Direct Known Subclasses: OutputStreamWriter
Description
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, CLDC 1.0


Fields
protected
java.lang.Object
lock
Constructors
protected Writer()
protected Writer(java.lang.Object lock)
Methods
abstract void close()
abstract void flush()
void write(char[] cbuf)
abstract void write(char[] cbuf, int off, int len)
void write(int c)
void write(java.lang.String str)
void write(java.lang.String str, int off, int len)


Methods inherited from class Object
equals(Object), getClass(), hashCode(), notify(), notifyAll(), toString(), wait(),
wait(), wait()


Fields
lock
Declaration:
protected java.lang.Object lock
Description:
The object used to synchronize operations on this stream. For efficiency, a character-stream object may use
an object other than itself to protect critical sections. A subclass should therefore use the object in this field
rather than this or a synchronized method.
Constructors
Writer()
Declaration:
protected Writer()
Description:
Create a new character-stream writer whose critical sections will synchronize on the writer itself.
Writer(Object)
Declaration:
protected Writer(java.lang.Object lock)
Description:
Create a new character-stream writer whose critical sections will synchronize on the given object.
Parameters:
lock - Object to synchronize on.


Methods
write(int)
Declaration:
public void write(int c)
throws IOException
Description:
Write a single character. The character to be written is contained in the 16 low-order bits of the given
integer value; the 16 high-order bits are ignored.
Subclasses that intend to support efficient single-character output should override this method.
Parameters:
c - int specifying a character to be written.
Throws:
IOException - If an I/O error occurs


write(char[])
84
write(char[])
Declaration:
public void write(char[] cbuf)
throws IOException
Description:
Write an array of characters.
Parameters:
cbuf - Array of characters to be written
Throws:
IOException - If an I/O error occurs
write(char[], int, int)
Declaration:
public abstract void write(char[] cbuf, int off, int len)
throws IOException
Description:
Write a portion of an array of characters.
Parameters:
cbuf - Array of characters
off - Offset from which to start writing characters
len - Number of characters to write
Throws:
IOException - If an I/O error occurs





No comments:

Post a Comment