java.io.OutputStreamWriter (JDK 1.1)
This class is a character output stream that uses a byte output stream as the destination for its data: when characters are written to an OutputStreamWriter, it translates them into bytes according to a particular locale- and/or platform-specific character encoding, and writes those bytes to the specified OutputStream. This is a very important internationalization feature in Java 1.1.
When you create an OutputStreamWriter, you specify the OutputStream to which it writes bytes, and you optionally specify the name of the character encoding that should be used to convert characters to bytes. If you do not specify an encoding name, the OutputStreamWriter uses the default encoding of the default locale, which is usually the correct thing to do.
OutputStreamWriter supports the usual Writer methods. It also has a getEncoding() method which returns the name of the encoding being used to convert characters to bytes.
public classOutputStreamWriterextends Writer { //Public ConstructorspublicOutputStreamWriter(OutputStreamout, Stringenc) throws UnsupportedEncodingException; publicOutputStreamWriter(OutputStreamout); //Public Instance Methodspublic voidclose() throws IOException; //Defines Writerpublic voidflush() throws IOException; //Defines Writerpublic StringgetEncoding(); public voidwrite(intc) throws IOException; //Overrides Writerpublic voidwrite(char[]cbuf, intoff, intlen) throws IOException; //Defines Writerpublic voidwrite(Stringstr, intoff, intlen) throws IOException; //Overrides Writer}
Hierarchy:
Object->Writer->OutputStreamWriter
Extended By:
FileWriter