java.io.OutputStreamWriter
An OutputStreamWriter is a bridge from character streams to byte streams: Characters written to it are encoded into bytes using a specified charset. The charset that it uses may be specified by name or may be given explicitly, or the platform default charset may be accepted.
The OutputStreamWriter class of the java.io package can be used to convert data in character form into data in bytes form.
It extends the abstract class Writer.
Implemented Interfaces:
Closeable, Flushable, Appendable, AutoCloseable
Subclasses:
FileWriter
Some methods of OutputStreamWriter class
close(): This method closes the stream, flushing it first.
flush(): This method flushes the stream.
getEncoding(): This method returns the name of the character encoding being used by this stream.
OutputStreamWriter(OutputStream): This method creates an OutputStreamWriter that uses the default character encoding.
OutputStreamWriter(OutputStream, Charset): This method creates an OutputStreamWriter that uses the given charset.
OutputStreamWriter(OutputStream, CharsetEncoder): This method creates an OutputStreamWriter that uses the given charset encoder.
OutputStreamWriter(OutputStream, String): This method creates an OutputStreamWriter that uses the named charset.
write(int): This method writes a single character.
write(char[], int, int): This method writes a portion of an array of characters.
write(String, int, int): This method writes a portion of a string.
No comments:
Post a Comment