anon.proxy
Class DecompressionProxyCallback
java.lang.Object
anon.proxy.DecompressionProxyCallback
- All Implemented Interfaces:
- ProxyCallback
public class DecompressionProxyCallback
- extends java.lang.Object
- implements ProxyCallback
This class provides functionality for inflating zlib- or gzip-compressed content.
Due to http header replacement the JonDo may specify some content-encodings
which a client (i.e wget) does not support. In this case the JonDo decodes the content
itself using this class. To use its functionality, an object of this class must be registered
in the PoxyCallback-framework.
- Author:
- Simon Pecher
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
decompressionKits
java.util.Hashtable decompressionKits
FHCRC
private static final int FHCRC
- these constants are copied from GZIPInputstream
because they are declared private there.
- See Also:
- Constant Field Values
FEXTRA
private static final int FEXTRA
- See Also:
- Constant Field Values
FNAME
private static final int FNAME
- See Also:
- Constant Field Values
FCOMMENT
private static final int FCOMMENT
- See Also:
- Constant Field Values
MAX_DECOMPRESSION_OUTPUT
private final int MAX_DECOMPRESSION_OUTPUT
- See Also:
- Constant Field Values
DecompressionProxyCallback
public DecompressionProxyCallback()
readGZIPHeader
private int readGZIPHeader(byte[] data,
int offset,
int length)
throws java.util.zip.DataFormatException
- slightly modified version of private method GZIPInputStream.readHeader to extract
the GZIP header fields.
returns the length of the header in bytes.
- Throws:
java.util.zip.DataFormatException
toUnsignedShort
private int toUnsignedShort(byte lower,
byte upper)
toUnsignedByte
private int toUnsignedByte(byte nByte)
closeRequest
public void closeRequest(AnonProxyRequest anonRequest)
- Specified by:
closeRequest
in interface ProxyCallback
handleDownstreamChunk
public int handleDownstreamChunk(AnonProxyRequest anonRequest,
ProxyCallbackBuffer buffer)
throws ProxyCallbackNotProcessableException
- Specified by:
handleDownstreamChunk
in interface ProxyCallback
- Throws:
ProxyCallbackNotProcessableException
handleUpstreamChunk
public int handleUpstreamChunk(AnonProxyRequest anonRequest,
ProxyCallbackBuffer buffer)
throws ProxyCallbackNotProcessableException
- Specified by:
handleUpstreamChunk
in interface ProxyCallback
- Throws:
ProxyCallbackNotProcessableException