|
CoherenceTM v3.3 Copyright© 2000-2007 by Oracle Corporation |
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.io.Writer
com.tangosol.io.Utf8Writer
public class Utf8Writer
A Utf8Writer is used to write character data onto an underlying stream.
Field Summary |
---|
Fields inherited from class java.io.Writer |
---|
lock |
Constructor Summary | |
---|---|
Utf8Writer()
Construct a Utf8Writer that buffers the output. |
|
Utf8Writer(OutputStream stream)
Construct a Utf8Writer that puts the output into an OutputStream. |
Method Summary | |
---|---|
void |
close()
Close the stream, flushing it first. |
void |
flush()
Flush the stream. |
byte[] |
toByteArray()
If the underlying stream is a ByteArrayOutputStream (such as with the no-parameter constructor), this will return the binary UTF8-encoded data that resulted from the character data written to this Writer. |
void |
write(char[] ach)
Write an array of characters. |
void |
write(char[] ach,
int of,
int cch)
Write a portion of an array of characters. |
void |
write(int ch)
Write a single character. |
void |
write(String s)
Write a string. |
void |
write(String s,
int of,
int cch)
Write a portion of a string. |
Methods inherited from class java.io.Writer |
---|
append, append, append, append, append, append |
Constructor Detail |
---|
public Utf8Writer()
public Utf8Writer(OutputStream stream)
stream
- the underlying stream to write toMethod Detail |
---|
public void write(int ch) throws IOException
Subclasses that intend to support efficient single-character output should override this method.
write
in class Writer
ch
- int specifying a character to be written.
IOException
public void write(char[] ach) throws IOException
write
in class Writer
ach
- array of characters to write
IOException
public void write(char[] ach, int of, int cch) throws IOException
write
in class Writer
ach
- array of characters to write fromof
- offset from which to start writing characterscch
- number of characters to write
IOException
public void write(String s) throws IOException
write
in class Writer
s
- the String to write
IOException
public void write(String s, int of, int cch) throws IOException
write
in class Writer
s
- the String to write fromof
- offset from which to start writing characterscch
- number of characters to write
IOException
public void flush() throws IOException
flush
in interface Flushable
flush
in class Writer
IOException
- If an I/O error occurspublic void close() throws IOException
close
in interface Closeable
close
in class Writer
IOException
- If an I/O error occurspublic byte[] toByteArray()
ClassCastException
- if the underlying stream is not
ByteArrayOutputStream
|
CoherenceTM v3.3 Copyright© 2000-2007 by Oracle Corporation |
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |