public interface IHTTPEncodingHandler
Interface for defining HTTP encoding handlers. A HTTP encoding handler is able to decode data from an
InputStream
and encode data to an OutputStream
.
Encodings are specified in HTTP headers such as content-encoding
, transfer-encoding
,
accept-encoding
.
Encoding handlers should be registered in the HTTPServer
in order to use them.
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getId()
Returns the name of the supported encoding.
|
java.io.InputStream |
open(java.io.InputStream original)
Returns an
InputStream to read the decoded data from the original InputStream . |
java.io.OutputStream |
open(java.io.OutputStream original)
Wraps the
original OutputStream with a special OutputStream which performs the
encoding. |
java.lang.String getId()
Returns the name of the supported encoding.
String
in lower case format.java.io.InputStream open(java.io.InputStream original) throws java.io.IOException
Returns an InputStream
to read the decoded data from the original
InputStream
.
original
- the InputStream
to read the encoded data.InputStream
to read the decoded data.java.io.IOException
- if any I/O error occursjava.io.OutputStream open(java.io.OutputStream original) throws java.io.IOException
Wraps the original
OutputStream
with a special OutputStream
which performs the
encoding. Returns an OutputStream
to encode the data from the original
OutputStream
.
original
- the output stream to wrapOutputStream
to encode the data.java.io.IOException
- if any I/O error occurs