Top Description Fields Constructors Methods
org.apache.http.impl.io

public abstract Class AbstractMessageWriter<T extends org.apache.http.HttpMessage>

extends Object
implements HttpMessageWriter<T extends HttpMessage>
Class Inheritance
All Implemented Interfaces
org.apache.http.io.HttpMessageWriter
Known Direct Subclasses
org.apache.http.impl.io.DefaultHttpRequestWriter, org.apache.http.impl.io.DefaultHttpResponseWriter, org.apache.http.impl.io.HttpRequestWriter, org.apache.http.impl.io.HttpResponseWriter
Annotations
@SuppressWarnings:deprecation
Imports
java.io.IOException, org.apache.http.Header, .HeaderIterator, .HttpException, .HttpMessage, org.apache.http.io.HttpMessageWriter, .SessionOutputBuffer, org.apache.http.message.BasicLineFormatter, .LineFormatter, org.apache.http.params.HttpParams, org.apache.http.util.Args, .CharArrayBuffer

Abstract base class for HTTP message writers that serialize output to an instance of SessionOutputBuffer.
Since
4.0

Field Summary

Modifier and TypeField and Description
protected final CharArrayBuffer
protected final LineFormatter
protected final SessionOutputBuffer

Constructor Summary

AccessConstructor and Description
public
AbstractMessageWriter(final SessionOutputBuffer
the session output buffer.
buffer
,
final LineFormatter
the line formatter.
formatter
,
final HttpParams
HTTP parameters.
params
)

Creates an instance of AbstractMessageWriter.
public
AbstractMessageWriter(final SessionOutputBuffer
the session output buffer.
buffer
,
final LineFormatter
the line formatter If null BasicLineFormatter#INSTANCE will be used.
formatter
)

Creates an instance of AbstractMessageWriter.

Method Summary

Modifier and TypeMethod and Description
public void
write(final T
HTTP message
message
)

Implements org.apache.http.io.HttpMessageWriter.write.

Serializes an instance of HttpMessage to the underlying data sink.
protected abstract void
writeHeadLine(T
the message whose first line is to be written out.
message
)

Subclasses must override this method to write out the first header line based on the HttpMessage passed as a parameter.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

lineBufback to summary
protected final CharArrayBuffer lineBuf
lineFormatterback to summary
protected final LineFormatter lineFormatter
sessionBufferback to summary
protected final SessionOutputBuffer sessionBuffer

Constructor Detail

AbstractMessageWriterback to summary
public AbstractMessageWriter(final SessionOutputBuffer buffer, final LineFormatter formatter, final HttpParams params)

Creates an instance of AbstractMessageWriter.

Parameters
buffer:SessionOutputBuffer

the session output buffer.

formatter:LineFormatter

the line formatter.

params:HttpParams

HTTP parameters.

Annotations
@Deprecated
AbstractMessageWriterback to summary
public AbstractMessageWriter(final SessionOutputBuffer buffer, final LineFormatter formatter)

Creates an instance of AbstractMessageWriter.

Parameters
buffer:SessionOutputBuffer

the session output buffer.

formatter:LineFormatter

the line formatter If null BasicLineFormatter#INSTANCE will be used.

Since
4.3

Method Detail

writeback to summary
public void write(final T message) throws IOException, HttpException

Implements org.apache.http.io.HttpMessageWriter.write.

Doc from org.apache.http.io.HttpMessageWriter.write.

Serializes an instance of HttpMessage to the underlying data sink.

Parameters
message:T

HTTP message

Annotations
@Override
Exceptions
IOException:
in case of an I/O error
HttpException:
in case of HTTP protocol violation
writeHeadLineback to summary
protected abstract void writeHeadLine(T message) throws IOException

Subclasses must override this method to write out the first header line based on the HttpMessage passed as a parameter.

Parameters
message:T

the message whose first line is to be written out.

Exceptions
IOException:
in case of an I/O error.