Class DefaultHttpResponseWriter<T extends HttpResponse>
- java.lang.Object
-
- org.apache.hc.core5.http.impl.nio.AbstractMessageWriter<T>
-
- org.apache.hc.core5.http.impl.nio.DefaultHttpResponseWriter<T>
-
- Type Parameters:
T- The type ofHttpResponse.
- All Implemented Interfaces:
NHttpMessageWriter<T>
public class DefaultHttpResponseWriter<T extends HttpResponse> extends AbstractMessageWriter<T>
DefaultNHttpMessageWriterimplementation forHttpResponses.- Since:
- 4.1
-
-
Field Summary
Fields Modifier and Type Field Description private Http1Confighttp1Config
-
Constructor Summary
Constructors Constructor Description DefaultHttpResponseWriter()DefaultHttpResponseWriter(LineFormatter formatter)Creates an instance of DefaultHttpResponseWriter.DefaultHttpResponseWriter(LineFormatter formatter, Http1Config http1Config)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected HttpVersionprotocolVersion(T request)Determines the HTTP protocol version to be communicated to the opposite endpoint in the message header.protected voidwriteHeadLine(T message, CharArrayBuffer lineBuf)Writes out the first line ofHttpMessage.-
Methods inherited from class org.apache.hc.core5.http.impl.nio.AbstractMessageWriter
getLineFormatter, reset, write
-
-
-
-
Field Detail
-
http1Config
private final Http1Config http1Config
-
-
Constructor Detail
-
DefaultHttpResponseWriter
public DefaultHttpResponseWriter(LineFormatter formatter, Http1Config http1Config)
- Since:
- 5.3
-
DefaultHttpResponseWriter
public DefaultHttpResponseWriter(LineFormatter formatter)
Creates an instance of DefaultHttpResponseWriter.- Parameters:
formatter- the line formatter IfnullBasicLineFormatter.INSTANCEwill be used.- Since:
- 4.3
-
DefaultHttpResponseWriter
public DefaultHttpResponseWriter()
- Since:
- 4.3
-
-
Method Detail
-
protocolVersion
protected HttpVersion protocolVersion(T request)
Determines the HTTP protocol version to be communicated to the opposite endpoint in the message header.- Since:
- 5.3
-
writeHeadLine
protected void writeHeadLine(T message, CharArrayBuffer lineBuf) throws java.io.IOException
Description copied from class:AbstractMessageWriterWrites out the first line ofHttpMessage.- Specified by:
writeHeadLinein classAbstractMessageWriter<T extends HttpResponse>- Parameters:
message- HTTP message.- Throws:
java.io.IOException- in case of an I/O error.
-
-