| java.lang.Object java.io.Writer java.io.OutputStreamWriter
All known Subclasses: java.io.FileWriter,
OutputStreamWriter | public class OutputStreamWriter extends Writer (Code) | | An OutputStreamWriter is a bridge from character streams to byte streams:
Characters written to it are translated into bytes.
The encoding that it uses may be specified by name, or the platform's default
encoding may be accepted.
Each invocation of a write() method causes the encoding converter to be
invoked on the given character(s). The resulting bytes are accumulated in a
buffer before being written to the underlying output stream. The size of
this buffer may be specified, but by default it is large enough for most
purposes. Note that the characters passed to the write() methods are not
buffered.
version: 12/17/01 (CLDC 1.1) See Also: java.io.Writer See Also: java.io.UnsupportedEncodingException since: CLDC 1.0 |
Method Summary | |
public void | close() Close the stream. | public void | flush() Flush the stream. | public void | write(int c) Write a single character. | public void | write(char cbuf, int off, int len) Write a portion of an array of characters. | public void | write(String str, int off, int len) Write a portion of a string. |
OutputStreamWriter | public OutputStreamWriter(OutputStream os)(Code) | | Create an OutputStreamWriter that uses the default character encoding.
Parameters: os - An OutputStream |
write | public void write(char cbuf, int off, int len) throws IOException(Code) | | Write a portion of an array of characters.
Parameters: cbuf - Buffer of characters to be written Parameters: off - Offset from which to start reading characters Parameters: len - Number of characters to be written exception: IOException - If an I/O error occurs |
write | public void write(String str, int off, int len) throws IOException(Code) | | Write a portion of a string.
Parameters: str - String to be written Parameters: off - Offset from which to start reading characters Parameters: len - Number of characters to be written exception: IOException - If an I/O error occurs |
|
|