Package org.apache.http.impl.nio.codecs
Class AbstractMessageWriter<T extends HttpMessage>
- java.lang.Object
-
- org.apache.http.impl.nio.codecs.AbstractMessageWriter<T>
-
- All Implemented Interfaces:
NHttpMessageWriter<T>
- Direct Known Subclasses:
DefaultHttpRequestWriter
,DefaultHttpResponseWriter
,HttpRequestWriter
,HttpResponseWriter
public abstract class AbstractMessageWriter<T extends HttpMessage> extends java.lang.Object implements NHttpMessageWriter<T>
AbstractNHttpMessageWriter
that serves as a base for all message writer implementations.- Since:
- 4.0
-
-
Constructor Summary
Constructors Constructor Description AbstractMessageWriter(SessionOutputBuffer buffer, LineFormatter formatter)
Creates an instance of AbstractMessageWriter.AbstractMessageWriter(SessionOutputBuffer buffer, LineFormatter formatter, HttpParams params)
Deprecated.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
reset()
Resets the writer.void
write(T message)
Serializes out the HTTP message head.
-
-
-
Constructor Detail
-
AbstractMessageWriter
@Deprecated public AbstractMessageWriter(SessionOutputBuffer buffer, LineFormatter formatter, HttpParams params)
Deprecated.Creates an instance of this class.- Parameters:
buffer
- the session output buffer.formatter
- the line formatter.params
- HTTP parameters.
-
AbstractMessageWriter
public AbstractMessageWriter(SessionOutputBuffer buffer, LineFormatter formatter)
Creates an instance of AbstractMessageWriter.- Parameters:
buffer
- the session output buffer.formatter
- the line formatter Ifnull
BasicLineFormatter.INSTANCE
will be used.- Since:
- 4.3
-
-
Method Detail
-
reset
public void reset()
Description copied from interface:NHttpMessageWriter
Resets the writer. The writer will be ready to start serializing another HTTP message.- Specified by:
reset
in interfaceNHttpMessageWriter<T extends HttpMessage>
-
write
public void write(T message) throws java.io.IOException, HttpException
Description copied from interface:NHttpMessageWriter
Serializes out the HTTP message head.- Specified by:
write
in interfaceNHttpMessageWriter<T extends HttpMessage>
- Parameters:
message
- HTTP message.- Throws:
java.io.IOException
- in case of an I/O error.HttpException
- in case the HTTP message is malformed or violates the HTTP protocol.
-
-