@NotThreadSafe public abstract class AbstractMessageWriter<T extends HttpMessage> extends java.lang.Object implements HttpMessageWriter<T>
SessionOutputBuffer
.Modifier and Type | Field and Description |
---|---|
protected CharArrayBuffer |
lineBuf |
protected LineFormatter |
lineFormatter |
protected SessionOutputBuffer |
sessionBuffer |
Constructor and Description |
---|
AbstractMessageWriter(SessionOutputBuffer buffer,
LineFormatter formatter)
Creates an instance of AbstractMessageWriter.
|
AbstractMessageWriter(SessionOutputBuffer buffer,
LineFormatter formatter,
HttpParams params)
Deprecated.
|
Modifier and Type | Method and Description |
---|---|
void |
write(T message)
Serializes an instance of
HttpMessage to the underlying data
sink. |
protected abstract void |
writeHeadLine(T message)
Subclasses must override this method to write out the first header line
based on the
HttpMessage passed as a parameter. |
protected final SessionOutputBuffer sessionBuffer
protected final CharArrayBuffer lineBuf
protected final LineFormatter lineFormatter
@Deprecated public AbstractMessageWriter(SessionOutputBuffer buffer, LineFormatter formatter, HttpParams params)
AbstractMessageWriter(SessionOutputBuffer, LineFormatter)
buffer
- the session output buffer.formatter
- the line formatter.params
- HTTP parameters.public AbstractMessageWriter(SessionOutputBuffer buffer, LineFormatter formatter)
buffer
- the session output buffer.formatter
- the line formatter If null
BasicLineFormatter.INSTANCE
will be used.protected abstract void writeHeadLine(T message) throws java.io.IOException
HttpMessage
passed as a parameter.message
- the message whose first line is to be written out.java.io.IOException
- in case of an I/O error.public void write(T message) throws java.io.IOException, HttpException
HttpMessageWriter
HttpMessage
to the underlying data
sink.write
in interface HttpMessageWriter<T extends HttpMessage>
message
- HTTP messagejava.io.IOException
- in case of an I/O errorHttpException
- in case of HTTP protocol violation