OutputStream. This class buffers small chunks of
output data in an internal byte array for optimal output performance.
writeLine(CharArrayBuffer, OutputStream) method of this class uses 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 BasicHttpTransportMetrics |
| Access | Constructor and Description |
|---|---|
| public | SessionOutputBufferImpl(final BasicHttpTransportMetrics
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 fragmentSizeHint, 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 | |
| public |
| Modifier and Type | Method and Description |
|---|---|
| public int | available()
Implements org. |
| public int | capacity()
Implements org. |
| public void | flush(final OutputStream outputStream)
Implements org. |
| private void | |
| public HttpTransportMetrics | getMetrics()
Implements org. HttpTransportMetrics for this session buffer.
|
| private void | |
| public int | length()
Implements org. |
| 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, final OutputStream outputStream)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, final OutputStream outputStream)Implements org. b.length bytes from the specified byte array
to this session buffer.
|
| public void | write(final int
the b, final OutputStream outputStream)byte.Implements org. |
| private void | |
| public void | writeLine(final CharArrayBuffer
the buffer containing chars of the line. charbuffer, final OutputStream outputStream)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 | |
| fragmentSizeHint | back to summary |
|---|---|
| private final int fragmentSizeHint | |
| metrics | back to summary |
|---|---|
| private final BasicHttpTransportMetrics metrics | |
| SessionOutputBufferImpl | back to summary |
|---|---|
| public SessionOutputBufferImpl(final BasicHttpTransportMetrics metrics, final int bufferSize, final int fragmentSizeHint, final CharsetEncoder charEncoder) Creates new instance of SessionOutputBufferImpl.
| |
| SessionOutputBufferImpl | back to summary |
|---|---|
| public SessionOutputBufferImpl(final int bufferSize) | |
| SessionOutputBufferImpl | back to summary |
|---|---|
| public SessionOutputBufferImpl(final int bufferSize, final CharsetEncoder encoder) | |
| available | back to summary |
|---|---|
| public int available() Implements org. Doc from org. Returns available space in the buffer.
| |
| 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(final OutputStream outputStream) 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(final OutputStream outputStream) 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, final OutputStream outputStream) throws IOException | |
| length | back to summary |
|---|---|
| public int length() Implements org. Doc from org. Return length data stored in the buffer
| |
| write | back to summary |
|---|---|
| public void write(final byte[] b, final int off, final int len, final OutputStream outputStream) throws IOException Implements org. Doc from org. Writes
If
| |
| write | back to summary |
|---|---|
| public void write(final byte[] b, final OutputStream outputStream) throws IOException Implements org. Doc from org. Writes
| |
| write | back to summary |
|---|---|
| public void write(final int b, final OutputStream outputStream) 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, final OutputStream outputStream) throws IOException | |
| writeLine | back to summary |
|---|---|
| public void writeLine(final CharArrayBuffer charbuffer, final OutputStream outputStream) 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.
| |