Package ej.hoka.http.encoding
Class ChunkedTransferCodingHandler
- java.lang.Object
-
- ej.hoka.http.encoding.ChunkedTransferCodingHandler
-
- All Implemented Interfaces:
TransferEncoding
public final class ChunkedTransferCodingHandler extends java.lang.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 java.lang.StringgetId()Returns the internal ID of theChunkedTransferCodingHandler.static ChunkedTransferCodingHandlergetInstance()Factory method to create an instance of ChunkedTransferCodingHandler.java.io.InputStreamopen(HttpRequest request, java.io.InputStream input)Creates aChunkedMessageBodyInputStreamto read the body of the HTTP request in "chunked" encoding from theHttpRequestand theInputStream.java.io.OutputStreamopen(HttpResponse response, java.io.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 java.lang.String getId()
Returns the internal ID of theChunkedTransferCodingHandler.- Specified by:
getIdin interfaceTransferEncoding- Returns:
- the String "chunked".
-
open
public java.io.InputStream open(HttpRequest request, java.io.InputStream input) throws java.io.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:
java.io.IOException- when I/O error occurs
-
open
public java.io.OutputStream open(HttpResponse response, java.io.OutputStream output) throws java.io.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:
java.io.IOException- if an I/O error occurs.
-
-