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 aFilterwhich 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 NextActionhandleClose(FilterChainContext ctx)Method perform the clean up of GZIP encoding/decoding state on a closedConnection.NextActionhandleRead(FilterChainContext ctx)Method decodes GZIP encoded data stored inFilterChainContext.getMessage()and, as the result, produces aBufferwith a plain data.NextActionhandleWrite(FilterChainContext ctx)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
-
-
-
-
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:
handleClosein interfaceFilter- Overrides:
handleClosein classBaseFilter- Parameters:
ctx- Context ofFilterChainContextprocessing.- 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 aBufferwith a plain data.- Specified by:
handleReadin interfaceFilter- Overrides:
handleReadin classBaseFilter- Parameters:
ctx- Context ofFilterChainContextprocessing.- 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 aBufferwith a GZIP compressed data.- Specified by:
handleWritein interfaceFilter- Overrides:
handleWritein classBaseFilter- Parameters:
ctx- Context ofFilterChainContextprocessing.- Returns:
- the next action
- Throws:
IOException
-
-