SessionOutputBufferImpl@Deprecated public abstract class AbstractSessionOutputBuffer extends java.lang.Object implements SessionOutputBuffer, BufferInfo
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 boolean |
ascii
Deprecated.
|
private java.nio.ByteBuffer |
bbuf
Deprecated.
|
private ByteArrayBuffer |
buffer
Deprecated.
|
private java.nio.charset.Charset |
charset
Deprecated.
|
private static byte[] |
CRLF
Deprecated.
|
private java.nio.charset.CharsetEncoder |
encoder
Deprecated.
|
private HttpTransportMetricsImpl |
metrics
Deprecated.
|
private int |
minChunkLimit
Deprecated.
|
private java.nio.charset.CodingErrorAction |
onMalformedCharAction
Deprecated.
|
private java.nio.charset.CodingErrorAction |
onUnmappableCharAction
Deprecated.
|
private java.io.OutputStream |
outstream
Deprecated.
|
| Modifier | Constructor and Description |
|---|---|
|
AbstractSessionOutputBuffer()
Deprecated.
|
protected |
AbstractSessionOutputBuffer(java.io.OutputStream outstream,
int buffersize,
java.nio.charset.Charset charset,
int minChunkLimit,
java.nio.charset.CodingErrorAction malformedCharAction,
java.nio.charset.CodingErrorAction unmappableCharAction)
Deprecated.
|
| Modifier and Type | Method and Description |
|---|---|
int |
available()
Deprecated.
Returns available space in the buffer.
|
int |
capacity()
Deprecated.
Returns total capacity of the buffer
|
protected HttpTransportMetricsImpl |
createTransportMetrics()
Deprecated.
|
void |
flush()
Deprecated.
Flushes this session buffer and forces any buffered output bytes
to be written out.
|
protected void |
flushBuffer()
Deprecated.
|
HttpTransportMetrics |
getMetrics()
Deprecated.
Returns
HttpTransportMetrics for this session buffer. |
private void |
handleEncodingResult(java.nio.charset.CoderResult result)
Deprecated.
|
protected void |
init(java.io.OutputStream outstream,
int buffersize,
HttpParams params)
Deprecated.
|
int |
length()
Deprecated.
Return length data stored in the buffer
|
void |
write(byte[] b)
Deprecated.
Writes
b.length bytes from the specified byte array
to this session buffer. |
void |
write(byte[] b,
int off,
int len)
Deprecated.
Writes
len bytes from the specified byte array
starting at offset off to this session buffer. |
void |
write(int b)
Deprecated.
Writes the specified byte to this session buffer.
|
private void |
writeEncoded(java.nio.CharBuffer cbuf)
Deprecated.
|
void |
writeLine(CharArrayBuffer charbuffer)
Deprecated.
Writes characters from the specified char array followed by a line
delimiter to this session buffer.
|
void |
writeLine(java.lang.String s)
Deprecated.
Writes characters from the specified string followed by a line delimiter
to this session buffer.
|
private static final byte[] CRLF
private java.io.OutputStream outstream
private ByteArrayBuffer buffer
private java.nio.charset.Charset charset
private boolean ascii
private int minChunkLimit
private HttpTransportMetricsImpl metrics
private java.nio.charset.CodingErrorAction onMalformedCharAction
private java.nio.charset.CodingErrorAction onUnmappableCharAction
private java.nio.charset.CharsetEncoder encoder
private java.nio.ByteBuffer bbuf
protected AbstractSessionOutputBuffer(java.io.OutputStream outstream,
int buffersize,
java.nio.charset.Charset charset,
int minChunkLimit,
java.nio.charset.CodingErrorAction malformedCharAction,
java.nio.charset.CodingErrorAction unmappableCharAction)
public AbstractSessionOutputBuffer()
protected void init(java.io.OutputStream outstream,
int buffersize,
HttpParams params)
protected HttpTransportMetricsImpl createTransportMetrics()
public int capacity()
BufferInfocapacity in interface BufferInfopublic int length()
BufferInfolength in interface BufferInfopublic int available()
BufferInfoavailable in interface BufferInfoprotected void flushBuffer()
throws java.io.IOException
java.io.IOExceptionpublic void flush()
throws java.io.IOException
SessionOutputBufferflush is
that calling it is an indication that, if any bytes previously
written have been buffered by the implementation of the output
stream, such bytes should immediately be written to their
intended destination.flush in interface SessionOutputBufferjava.io.IOException - if an I/O error occurs.public void write(byte[] b,
int off,
int len)
throws java.io.IOException
SessionOutputBufferlen bytes from the specified byte array
starting at offset off to this session buffer.
If off is negative, or len is negative, or
off+len is greater than the length of the array
b, then an IndexOutOfBoundsException is thrown.
write in interface SessionOutputBufferb - the data.off - the start offset in the data.len - the number of bytes to write.java.io.IOException - if an I/O error occurs.public void write(byte[] b)
throws java.io.IOException
SessionOutputBufferb.length bytes from the specified byte array
to this session buffer.write in interface SessionOutputBufferb - the data.java.io.IOException - if an I/O error occurs.public void write(int b)
throws java.io.IOException
SessionOutputBufferwrite in interface SessionOutputBufferb - the byte.java.io.IOException - if an I/O error occurs.public void writeLine(java.lang.String s)
throws java.io.IOException
This method uses CR-LF as a line delimiter.
writeLine in interface SessionOutputBuffers - the line.java.io.IOException - if an I/O error occurs.public void writeLine(CharArrayBuffer charbuffer) throws java.io.IOException
This method uses CR-LF as a line delimiter.
writeLine in interface SessionOutputBuffercharbuffer - the buffer containing chars of the line.java.io.IOException - if an I/O error occurs.private void writeEncoded(java.nio.CharBuffer cbuf)
throws java.io.IOException
java.io.IOExceptionprivate void handleEncodingResult(java.nio.charset.CoderResult result)
throws java.io.IOException
java.io.IOExceptionpublic HttpTransportMetrics getMetrics()
SessionOutputBufferHttpTransportMetrics for this session buffer.getMetrics in interface SessionOutputBuffer