Package ej.hoka.http.encoding
Class ChunkedTransferCodingHandler
- java.lang.Object
-
- ej.hoka.http.encoding.ChunkedTransferCodingHandler
-
- All Implemented Interfaces:
TransferEncoding
public final class ChunkedTransferCodingHandler extends Object implements TransferEncoding
HTTP-1.1 chunked transfer encoding handler to read and write data in chunked encoding.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetId()Returns the internal ID of theChunkedTransferCodingHandler.static ChunkedTransferCodingHandlergetInstance()Factory method to create an instance of ChunkedTransferCodingHandler.InputStreamopen(HttpRequest request, InputStream input)Creates aChunkedMessageBodyInputStreamto read the body of the HTTP request in "chunked" encoding from theHttpRequestand theInputStream.OutputStreamopen(HttpResponse response, OutputStream output)Creates anOutputStreamto write the body of the HTTP response in "chunked" encoding using theHttpResponseand theOutputStream.
-
-
-
Method Detail
-
getInstance
public static ChunkedTransferCodingHandler getInstance()
Factory method to create an instance of ChunkedTransferCodingHandler.- Returns:
- an instance of
ChunkedTransferCodingHandler
-
getId
public String getId()
Returns the internal ID of theChunkedTransferCodingHandler.- Specified by:
getIdin interfaceTransferEncoding- Returns:
- the String "chunked".
-
open
public InputStream open(HttpRequest request, InputStream input) throws IOException
Creates aChunkedMessageBodyInputStreamto read the body of the HTTP request in "chunked" encoding from theHttpRequestand theInputStream.- Specified by:
openin interfaceTransferEncoding- Parameters:
request- theHttpRequestinput- theInputStream- Returns:
- a new instance of
ChunkedMessageBodyInputStream - Throws:
IOException- when I/O error occurs
-
open
public OutputStream open(HttpResponse response, OutputStream output) throws IOException
Creates anOutputStreamto write the body of the HTTP response in "chunked" encoding using theHttpResponseand theOutputStream.- Specified by:
openin interfaceTransferEncoding- Parameters:
response- theHttpResponse.output- theOutputStream.- Returns:
- a new instance of
ChunkedMessageBodyOutputStream. - Throws:
IOException- if an I/O error occurs.
-
-