public class UTF8StreamWriter
extends java.io.Writer
| Constructor and Description |
|---|
UTF8StreamWriter(java.io.OutputStream out)
Create a UTF8StreamWriter around the specified OutputStream.
|
| Modifier and Type | Method and Description |
|---|---|
java.io.Writer |
append(char c)
Appends the specified character to this writer.
|
void |
close()
Closes the stream, flushing it first.
|
void |
flush()
Flushes the stream.
|
void |
write(char[] cbuf,
int off,
int len)
Writes a portion of an array of characters.
|
void |
write(int c)
Writes a single character.
|
void |
write(java.lang.String str,
int off,
int len)
Writes a portion of a string.
|
public UTF8StreamWriter(java.io.OutputStream out)
out - OutputStream to feed UTF-8 encoded datapublic void write(int c)
throws java.io.IOException
write in class java.io.Writerc - int specifying a character to be writtenjava.io.IOException - If an I/O error occurspublic java.io.Writer append(char c)
throws java.io.IOException
An invocation of this method of the form out.append(c)
behaves in exactly the same way as the invocation
out.write(c) append in interface java.lang.Appendableappend in class java.io.Writerc - The 16-bit character to appendjava.io.IOException - If an I/O error occurspublic void write(char[] cbuf,
int off,
int len)
throws java.io.IOException
write in class java.io.Writercbuf - Array of charactersoff - Offset from which to start writing characterslen - Number of characters to writejava.io.IOException - If an I/O error occurspublic void write(java.lang.String str,
int off,
int len)
throws java.io.IOException
write in class java.io.Writerstr - A Stringoff - Offset from which to start writing characterslen - Number of characters to writejava.lang.IndexOutOfBoundsException - If off is negative, or len is negative,
or off+len is negative or greater than the length
of the given stringjava.io.IOException - If an I/O error occurspublic void flush()
throws java.io.IOException
flush in interface java.io.Flushableflush in class java.io.Writerjava.io.IOException - If an I/O error occurspublic void close()
throws java.io.IOException
close in interface java.io.Closeableclose in interface java.lang.AutoCloseableclose in class java.io.Writerjava.io.IOException - If an I/O error occurs