public abstract class Writer extends Object implements Appendable ,Closeable , Flushable
Abstarct class for writing to character streams, The only methods that a subclass must implement are write(char[] , int ,int),flush() , close() .Most subclasses , howerver ,will override some of the methods defined here inorder to provide higher efficency ,additional functionality , or both
protected Object luck
The object used to sychronized operations on the stream, For efficiency , a character-stream object may use an object other than itself to protect critical-section A subclass should there use the object in the field rather than this or syvhronized method
public void write(int c) throws IOException
writes a single character.The character to be written is contained in the 16 loworder bits of the given integer value ; the 16-high-order bits are ignored
subclasses that intened to support efficient single-character output shoule override this method
public Writer append(CharSuquence csq) throws IOException
Appends the specified character suquence to the writer
An invocation of this method of the form out.append(csq) behaves in exactly ths same way as out.write(csq.toString())
Depending on the specification of toString for the character sequence csq, the entire sequence may not be appended. For instance, invoking the toString method of a character buffer will return a subsequence whose content depends upon the buffer's position and limit.
public abstract void flush() throws IOException
FLushes the stream If the stream has saved any characters from the various write()methods in a buffer ,write them immediately to their intend destination.THen if that destination is anther character or byte stream ,flush it.Thus one flush() invocation will flush at the buffers in a chain of Writers and OutputStreram()
If the intended destination of this stream is an abstraction provided by the underlying operating system, for example a file, then flushing the stream guarantees only that bytes previously written to the stream are passed to the operating system for writing; it does not guarantee that they are actually written to a physical device such as a disk drive.
public abstract void close()