|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.io.Writer org.elasticsearch.common.io.UTF8StreamWriter
public final class UTF8StreamWriter
Field Summary |
---|
Fields inherited from class java.io.Writer |
---|
lock |
Constructor Summary | |
---|---|
UTF8StreamWriter()
Creates a UTF-8 writer having a byte buffer of moderate capacity (2048). |
|
UTF8StreamWriter(int capacity)
Creates a UTF-8 writer having a byte buffer of specified capacity. |
Method Summary | |
---|---|
void |
close()
Closes and resets this writer for reuse. |
void |
flush()
Flushes the stream. |
void |
reset()
|
UTF8StreamWriter |
setOutput(OutputStream out)
Sets the output stream to use for writing until this writer is closed. |
UTF8StreamWriter |
setOutputStream(OutputStream out)
Deprecated. Replaced by setOutput(OutputStream) |
void |
write(char c)
Writes a single character. |
void |
write(char[] cbuf,
int off,
int len)
Writes a portion of an array of characters. |
void |
write(CharSequence csq)
Writes the specified character sequence. |
void |
write(int code)
Writes a character given its 31-bits Unicode. |
void |
write(String str,
int off,
int len)
Writes a portion of a string. |
Methods inherited from class java.io.Writer |
---|
append, append, append, write, write |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public UTF8StreamWriter()
public UTF8StreamWriter(int capacity)
capacity
- the capacity of the byte buffer.Method Detail |
---|
public UTF8StreamWriter setOutput(OutputStream out)
out
- the output stream.
IllegalStateException
- if this writer is being reused and
it has not been closed
or reset
.public void write(char c) throws IOException
c
- char
the character to be written (possibly
a surrogate).
IOException
- if an I/O error occurs.public void write(int code) throws IOException
write
in class Writer
code
- the 31 bits Unicode of the character to be written.
IOException
- if an I/O error occurs.public void write(char[] cbuf, int off, int len) throws IOException
write
in class Writer
cbuf
- the array of characters.off
- the offset from which to start writing characters.len
- the number of characters to write.
IOException
- if an I/O error occurs.public void write(String str, int off, int len) throws IOException
write
in class Writer
str
- a String.off
- the offset from which to start writing characters.len
- the number of characters to write.
IOException
- if an I/O error occurspublic void write(CharSequence csq) throws IOException
csq
- the character sequence.
IOException
- if an I/O error occurspublic void flush() throws IOException
flush
in interface Flushable
flush
in class Writer
IOException
- if an I/O error occurs.public void close() throws IOException
resets
this writer for reuse.
close
in interface Closeable
close
in class Writer
IOException
- if an I/O error occurspublic void reset()
public UTF8StreamWriter setOutputStream(OutputStream out)
setOutput(OutputStream)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |