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 aBufferwith a plain data.Method compresses plain data stored inFilterChainContext.getMessage()and, as the result, produces aBufferwith 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:
handleClosein interfaceFilter- Overrides:
handleClosein classBaseFilter- Parameters:
ctx- Context ofFilterChainContextprocessing.- Returns:
- the next action
- Throws:
IOException
-
handleRead
Method decodes GZIP encoded data stored inFilterChainContext.getMessage()and, as the result, produces aBufferwith a plain data.- Specified by:
handleReadin interfaceFilter- Overrides:
handleReadin classBaseFilter- Parameters:
ctx- Context ofFilterChainContextprocessing.- Returns:
- the next action
- Throws:
IOException
-
handleWrite
Method compresses plain data stored inFilterChainContext.getMessage()and, as the result, produces aBufferwith a GZIP compressed data.- Specified by:
handleWritein interfaceFilter- Overrides:
handleWritein classBaseFilter- Parameters:
ctx- Context ofFilterChainContextprocessing.- Returns:
- the next action
- Throws:
IOException
-