Name

java.io.OutputStreamWriter

Synopsis

This class is a slightly modified version of the OutputStreamReader class used in J2SE. The class outputs data from a character input stream, based on a specific encoding, to a byte input stream. The write() methods output a single character, an array (or sub-array) of characters, or a string (or sub-string) to the output stream. Other methods include flush(), which flushes the output buffer, and close(), which closes the output stream and releases any resources associated with it.

public classOutputStreamWriter extends java.io.Writer {
   // constructors
   public OutputStreamWriter(OutputStream os);
   public OutputStreamWriter(OutputStream os, String enc)
       throws java.io.UnsupportedEncodingException;

   // public instance methods
   public void write(int c) throws java.io.IOException;
   public void write(char[] cbuf, int off, int len)
      throws java.io.IOException;
   public void write(String str, int off, int len) 
      throws java.io.IOException;
   public void flush() throws java.io.IOException;
   public void close() throws java.io.IOException;
}

Get Wireless Java now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.