SessionOutputBufferImpl
@NotThreadSafe @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 | 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. |
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.
|
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.
|
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()
BufferInfo
capacity
in interface BufferInfo
public int length()
BufferInfo
length
in interface BufferInfo
public int available()
BufferInfo
available
in interface BufferInfo
protected void flushBuffer() throws java.io.IOException
java.io.IOException
public void flush() throws java.io.IOException
SessionOutputBuffer
flush
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 SessionOutputBuffer
java.io.IOException
- if an I/O error occurs.public void write(byte[] b, int off, int len) throws java.io.IOException
SessionOutputBuffer
len
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 SessionOutputBuffer
b
- 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
SessionOutputBuffer
b.length
bytes from the specified byte array
to this session buffer.write
in interface SessionOutputBuffer
b
- the data.java.io.IOException
- if an I/O error occurs.public void write(int b) throws java.io.IOException
SessionOutputBuffer
write
in interface SessionOutputBuffer
b
- 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 SessionOutputBuffer
s
- 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 SessionOutputBuffer
charbuffer
- the buffer containing chars of the line.java.io.IOException
- if an I/O error occurs.public HttpTransportMetrics getMetrics()
SessionOutputBuffer
HttpTransportMetrics
for this session buffer.getMetrics
in interface SessionOutputBuffer