DthingApi
|
Public Member Functions | |
OutputStreamWriter (OutputStream out) | |
OutputStreamWriter (OutputStream out, final String enc) throws UnsupportedEncodingException | |
void | close () throws IOException |
void | flush () throws IOException |
String | getEncoding () |
void | write (char[] buffer, int offset, int count) throws IOException |
void | write (int oneChar) throws IOException |
void | write (String str, int offset, int count) throws IOException |
![]() | |
abstract void | close () throws IOException |
abstract void | flush () throws IOException |
void | write (char[] buf) throws IOException |
abstract void | write (char[] buf, int offset, int count) throws IOException |
void | write (int oneChar) throws IOException |
void | write (String str) throws IOException |
void | write (String str, int offset, int count) throws IOException |
Additional Inherited Members | |
![]() | |
Writer () | |
Writer (Object lock) | |
![]() | |
Object | lock |
A class for turning a character stream into a byte stream. Data written to the target input stream is converted into bytes by either a default or a provided character converter. The default encoding is taken from the "file.encoding" system property.
contains a buffer of bytes to be written to target stream and converts these into characters as needed. The buffer size is 8K.
|
inline |
Constructs a new OutputStreamWriter using
as the target stream to write converted characters to. The default character encoding is used.
out | the non-null target stream to write converted bytes to. |
UnsupportedEncodingException |
|
inline |
Constructs a new OutputStreamWriter using
as the target stream to write converted characters to and
as the character encoding. If the encoding cannot be found, an UnsupportedEncodingException error is thrown.
out | the target stream to write converted bytes to. |
enc | the string describing the desired character encoding. |
NullPointerException | if enc null |
UnsupportedEncodingException | if the encoding specified by enc |
|
inline |
Closes this writer. This implementation flushes the buffer as well as the target stream. The target stream is then closed and the resources for the buffer and converter are released.
Only the first invocation of this method has any effect. Subsequent calls do nothing.
IOException | if an error occurs while closing this writer. |
|
inline |
Flushes this writer. This implementation ensures that all buffered bytes are written to the target stream. After writing the bytes, the target stream is flushed as well.
IOException | if an error occurs while flushing this writer. |
|
inline |
Returns the historical name of the encoding used by this writer to convert characters to bytes, or null if this writer has been closed. Most callers should probably keep track of the String or Charset they passed in; this method may not return the same name.
|
inline |
Writes
characters starting at
in
to this writer. The characters are immediately converted to bytes by the character converter and stored in a local buffer. If the buffer gets full as a result of the conversion, this writer is flushed.
buffer | the array containing characters to write. |
offset | the index of the first character in buf |
count | the maximum number of characters to write. |
IndexOutOfBoundsException | if offset < 0 count < 0 offset + count buf |
IOException | if this writer has already been closed or another I/O error occurs. |
|
inline |
Writes the character
to this writer. The lowest two bytes of the integer
are immediately converted to bytes by the character converter and stored in a local buffer. If the buffer gets full by converting this character, this writer is flushed.
oneChar | the character to write. |
IOException | if this writer is closed or another I/O error occurs. |
|
inline |
Writes
characters starting at
in
to this writer. The characters are immediately converted to bytes by the character converter and stored in a local buffer. If the buffer gets full as a result of the conversion, this writer is flushed.
str | the string containing characters to write. |
offset | the start position in str |
count | the maximum number of characters to write. |
IOException | if this writer has already been closed or another I/O error occurs. |
IndexOutOfBoundsException | if offset < 0 count < 0 offset + count str |