OutputStream. This class buffers small chunks of
output data in an internal byte array for optimal output performance.
writeLine(CharArrayBuffer) and writeLine(String) methods
of this class use CR-LF as a line delimiter.
| Modifier and Type | Field and Description |
|---|---|
| private ByteBuffer | |
| private final ByteArrayBuffer | |
| private static final byte[] | |
| private final CharsetEncoder | |
| private final int | |
| private final HttpTransportMetricsImpl | |
| private OutputStream |
| Access | Constructor and Description |
|---|---|
| public | SessionOutputBufferImpl(final HttpTransportMetricsImpl
HTTP transport metrics. metrics, final int buffer size. Must be a positive number. bufferSize, final int fragment size hint defining a minimal size of a fragment
that should be written out directly to the socket bypassing the session buffer.
Value fragementSizeHint, final CharsetEncoder 0 disables fragment buffering.charEncoder to be used for encoding HTTP protocol elements.
If charEncoder)null simple type cast will be used for char to byte conversion.Creates new instance of SessionOutputBufferImpl. |
| public |
| Modifier and Type | Method and Description |
|---|---|
| public int | available()
Implements org. |
| public void | |
| public int | |
| public void | flush()
Implements org. |
| private void | |
| private void | |
| public HttpTransportMetrics | getMetrics()
Implements org. HttpTransportMetrics for this session buffer.
|
| private void | |
| public boolean | |
| public int | |
| private void | |
| public void | write(final byte[]
the data. b, final int the start offset in the data. off, final int the number of bytes to write. len)Implements org. len bytes from the specified byte array
starting at offset off to this session buffer.
|
| public void | write(final byte[]
the data. b)Implements org. b.length bytes from the specified byte array
to this session buffer.
|
| public void | write(final int
the b)byte.Implements org. |
| private void | |
| public void | writeLine(final String
the line. s)Implements org. |
| public void | writeLine(final CharArrayBuffer
the buffer containing chars of the line. charbuffer)Implements org. |
| bbuf | back to summary |
|---|---|
| private ByteBuffer bbuf | |
| buffer | back to summary |
|---|---|
| private final ByteArrayBuffer buffer | |
| CRLF | back to summary |
|---|---|
| private static final byte[] CRLF | |
| encoder | back to summary |
|---|---|
| private final CharsetEncoder encoder | |
| fragementSizeHint | back to summary |
|---|---|
| private final int fragementSizeHint | |
| metrics | back to summary |
|---|---|
| private final HttpTransportMetricsImpl metrics | |
| outStream | back to summary |
|---|---|
| private OutputStream outStream | |
| SessionOutputBufferImpl | back to summary |
|---|---|
| public SessionOutputBufferImpl(final HttpTransportMetricsImpl metrics, final int bufferSize, final int fragementSizeHint, final CharsetEncoder charEncoder) Creates new instance of SessionOutputBufferImpl.
| |
| SessionOutputBufferImpl | back to summary |
|---|---|
| public SessionOutputBufferImpl(final HttpTransportMetricsImpl metrics, final int bufferSize) | |
| available | back to summary |
|---|---|
| public int available() Implements org. Doc from org. Returns available space in the buffer.
| |
| bind | back to summary |
|---|---|
| public void bind(final OutputStream outStream) | |
| capacity | back to summary |
|---|---|
| public int capacity() Implements org. Doc from org. Returns total capacity of the buffer
| |
| flush | back to summary |
|---|---|
| public void flush() throws IOException Implements org. Doc from org. Flushes this session buffer and forces any buffered output bytes
to be written out. The general contract of
| |
| flushBuffer | back to summary |
|---|---|
| private void flushBuffer() throws IOException | |
| flushStream | back to summary |
|---|---|
| private void flushStream() throws IOException | |
| getMetrics | back to summary |
|---|---|
| public HttpTransportMetrics getMetrics() Implements org. Doc from org. Returns
| |
| handleEncodingResult | back to summary |
|---|---|
| private void handleEncodingResult(final CoderResult result) throws IOException | |
| isBound | back to summary |
|---|---|
| public boolean isBound() | |
| length | back to summary |
|---|---|
| public int length() Implements org. Doc from org. Return length data stored in the buffer
| |
| streamWrite | back to summary |
|---|---|
| private void streamWrite(final byte[] b, final int off, final int len) throws IOException | |
| write | back to summary |
|---|---|
| public void write(final byte[] b, final int off, final int len) throws IOException Implements org. Doc from org. Writes
If
| |
| write | back to summary |
|---|---|
| public void write(final byte[] b) throws IOException Implements org. Doc from org. Writes
| |
| write | back to summary |
|---|---|
| public void write(final int b) throws IOException Implements org. Doc from org. Writes the specified byte to this session buffer.
| |
| writeEncoded | back to summary |
|---|---|
| private void writeEncoded(final CharBuffer cbuf) throws IOException | |
| writeLine | back to summary |
|---|---|
| public void writeLine(final String s) throws IOException Implements org. Writes characters from the specified string followed by a line delimiter to this session buffer. This method uses CR-LF as a line delimiter.
| |
| writeLine | back to summary |
|---|---|
| public void writeLine(final CharArrayBuffer charbuffer) throws IOException Implements org. Writes characters from the specified char array followed by a line delimiter to this session buffer. This method uses CR-LF as a line delimiter.
| |