Class GZipFilter
- java.lang.Object
-
- org.glassfish.grizzly.filterchain.BaseFilter
-
- org.glassfish.grizzly.compression.zip.GZipFilter
-
- All Implemented Interfaces:
Filter
public class GZipFilter extends BaseFilter
This class implements aFilter
which encodes/decodes data in the GZIP format.- Author:
- Alexey Stashok
-
-
Constructor Summary
Constructors Constructor Description GZipFilter()
Construct GZipFilter using default buffer sizes.GZipFilter(int inBufferSize, int outBufferSize)
Construct GZipFilter using specific buffer sizes.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description NextAction
handleClose(FilterChainContext ctx)
Method perform the clean up of GZIP encoding/decoding state on a closedConnection
.NextAction
handleRead(FilterChainContext ctx)
Method decodes GZIP encoded data stored inFilterChainContext.getMessage()
and, as the result, produces aBuffer
with a plain data.NextAction
handleWrite(FilterChainContext ctx)
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
-
-
-
-
Method Detail
-
handleClose
public NextAction handleClose(FilterChainContext ctx) throws IOException
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
public NextAction handleRead(FilterChainContext ctx) throws IOException
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
public NextAction handleWrite(FilterChainContext ctx) throws IOException
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
-
-