java.lang.Object
org.glassfish.grizzly.filterchain.BaseFilter
org.glassfish.grizzly.compression.zip.GZipFilter
- All Implemented Interfaces:
Filter
This class implements a
Filter
which encodes/decodes data in the GZIP
format.- Author:
- Alexey Stashok
-
Constructor Summary
ConstructorsConstructorDescriptionConstruct GZipFilter using default buffer sizes.GZipFilter
(int inBufferSize, int outBufferSize) Construct GZipFilter using specific buffer sizes. -
Method Summary
Modifier and TypeMethodDescriptionMethod perform the clean up of GZIP encoding/decoding state on a closedConnection
.Method decodes GZIP encoded data stored inFilterChainContext.getMessage()
and, as the result, produces aBuffer
with a plain data.Method compresses plain data stored inFilterChainContext.getMessage()
and, as the result, produces aBuffer
with a GZIP compressed data.Methods inherited from class org.glassfish.grizzly.filterchain.BaseFilter
createContext, exceptionOccurred, handleAccept, handleConnect, handleEvent, onAdded, onFilterChainChanged, onRemoved, toString
-
Constructor Details
-
GZipFilter
public GZipFilter()Construct GZipFilter using default buffer sizes. -
GZipFilter
public GZipFilter(int inBufferSize, int outBufferSize) Construct GZipFilter using specific buffer sizes.- Parameters:
inBufferSize
- input buffer sizeoutBufferSize
- output buffer size
-
-
Method Details
-
handleClose
Method perform the clean up of GZIP encoding/decoding state on a closedConnection
.- Specified by:
handleClose
in interfaceFilter
- Overrides:
handleClose
in classBaseFilter
- Parameters:
ctx
- Context ofFilterChainContext
processing.- Returns:
- the next action
- Throws:
IOException
-
handleRead
Method decodes GZIP encoded data stored inFilterChainContext.getMessage()
and, as the result, produces aBuffer
with a plain data.- Specified by:
handleRead
in interfaceFilter
- Overrides:
handleRead
in classBaseFilter
- Parameters:
ctx
- Context ofFilterChainContext
processing.- Returns:
- the next action
- Throws:
IOException
-
handleWrite
Method compresses plain data stored inFilterChainContext.getMessage()
and, as the result, produces aBuffer
with a GZIP compressed data.- Specified by:
handleWrite
in interfaceFilter
- Overrides:
handleWrite
in classBaseFilter
- Parameters:
ctx
- Context ofFilterChainContext
processing.- Returns:
- the next action
- Throws:
IOException
-