| Modifier and Type | Field and Description |
|---|---|
| private static final int | BYTES_MAX
number of bytes that the byte buffer can hold. |
| private static final int | CHARS_MAX
number of characters that the character buffer can hold. |
| private int | count
The number of valid bytes in the buffer. |
| private final char[] | |
| private final OutputStream | m_os
The byte stream to write to. |
| private final byte[] | m_outputBytes
The internal buffer where data is stored. |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public void | close()
Implements abstract java. Implements com. Close the stream, flushing it first. |
| public void | flush()
Implements abstract java. Implements com. Flush the stream. |
| public void | |
| public OutputStream | Returns: reference to the result stream, or null of only a writer was set.Implements com. Get the output stream where the events will be serialized to. |
| public Writer | getWriter()
Implements com. If this method returns null, getOutputStream() must return non-null. |
| public void | write(final int
int specifying a character to be written. c)Overrides java. Implements com. Write a single character. |
| public void | write(final char[]
Array of characters chars, final int Offset from which to start writing characters start, final int Number of characters to write length)Implements abstract java. Implements com. Write a portion of an array of characters. |
| public void | write(final String
String to be written s)Overrides java. Implements com. Write a string. |
| BYTES_MAX | back to summary |
|---|---|
| private static final int BYTES_MAX number of bytes that the byte buffer can hold. This is a fixed constant is used rather than m_outputBytes.lenght for performance. | |
| CHARS_MAX | back to summary |
|---|---|
| private static final int CHARS_MAX number of characters that the character buffer can hold. This is 1/3 of the number of bytes because UTF-8 encoding can expand one unicode character by up to 3 bytes. | |
| count | back to summary |
|---|---|
| private int count The number of valid bytes in the buffer. This value is always in the range 0 through m_outputBytes.length; elements m_outputBytes[0] through m_outputBytes[count-1] contain valid byte data. | |
| m_inputChars | back to summary |
|---|---|
| private final char[] m_inputChars | |
| m_os | back to summary |
|---|---|
| private final OutputStream m_os The byte stream to write to. (sc & sb remove final to compile in JDK 1.1.8) | |
| m_outputBytes | back to summary |
|---|---|
| private final byte[] m_outputBytes The internal buffer where data is stored. (sc & sb remove final to compile in JDK 1.1.8) | |
| WriterToUTF8Buffered | back to summary |
|---|---|
| public WriterToUTF8Buffered(OutputStream out) throws UnsupportedEncodingException Create an buffered UTF-8 writer.
| |
| close | back to summary |
|---|---|
| public void close() throws IOException Implements abstract java. Implements com. Close the stream, flushing it first. Once a stream has been closed, further write() or flush() invocations will cause an IOException to be thrown. Closing a previously-closed stream, however, has no effect.
| |
| flush | back to summary |
|---|---|
| public void flush() throws IOException Implements abstract java. Implements com. Flush the stream. If the stream has saved any characters from the various write() methods in a buffer, write them immediately to their intended destination. Then, if that destination is another character or byte stream, flush it. Thus one flush() invocation will flush all the buffers in a chain of Writers and OutputStreams.
| |
| flushBuffer | back to summary |
|---|---|
| public void flushBuffer() throws IOException Flush the internal buffer | |
| getOutputStream | back to summary |
|---|---|
| public OutputStream getOutputStream() Implements com. Get the output stream where the events will be serialized to.
| |
| getWriter | back to summary |
|---|---|
| public Writer getWriter() Implements com. Doc from com. If this method returns null, getOutputStream() must return non-null. Get the writer that this writer sends its output to. It is possible that the Writer returned by this method does not implement the WriterChain interface. | |
| write | back to summary |
|---|---|
| public void write(final int c) throws IOException Overrides java. Implements com. Write a single character. The character to be written is contained in the 16 low-order bits of the given integer value; the 16 high-order bits are ignored. Subclasses that intend to support efficient single-character output should override this method.
| |
| write | back to summary |
|---|---|
| public void write(final char[] chars, final int start, final int length) throws IOException Implements abstract java. Implements com. Write a portion of an array of characters.
| |
| write | back to summary |
|---|---|
| public void write(final String s) throws IOException Overrides java. Implements com. Write a string.
| |