org.glassfish.grizzly.compression.zip
Class GZipFilter

java.lang.Object
  extended by org.glassfish.grizzly.filterchain.BaseFilter
      extended by org.glassfish.grizzly.compression.zip.GZipFilter
All Implemented Interfaces:
Filter

public class GZipFilter
extends BaseFilter

This class implements a Filter which encodes/decodes data in the GZIP format.

Author:
Alexey Stashok

Constructor Summary
GZipFilter()
          Construct GZipFilter using default buffer sizes.
GZipFilter(int inBufferSize, int outBufferSize)
          Construct GZipFilter using specific buffer sizes.
 
Method Summary
 NextAction handleClose(FilterChainContext ctx)
          Method perform the clean up of GZIP encoding/decoding state on a closed Connection.
 NextAction handleRead(FilterChainContext ctx)
          Method decodes GZIP encoded data stored in FilterChainContext.getMessage() and, as the result, produces a Buffer with a plain data.
 NextAction handleWrite(FilterChainContext ctx)
          Method compresses plain data stored in FilterChainContext.getMessage() and, as the result, produces a Buffer with a GZIP compressed data.
 
Methods inherited from class org.glassfish.grizzly.filterchain.BaseFilter
createContext, exceptionOccurred, getFilterChain, getIndex, handleAccept, handleConnect, handleEvent, onAdded, onFilterChainChanged, onRemoved
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

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 size
outBufferSize - output buffer size
Method Detail

handleClose

public NextAction handleClose(FilterChainContext ctx)
                       throws IOException
Method perform the clean up of GZIP encoding/decoding state on a closed Connection.

Specified by:
handleClose in interface Filter
Overrides:
handleClose in class BaseFilter
Parameters:
ctx - Context of FilterChainContext processing.
Returns:
the next action
Throws:
IOException

handleRead

public NextAction handleRead(FilterChainContext ctx)
                      throws IOException
Method decodes GZIP encoded data stored in FilterChainContext.getMessage() and, as the result, produces a Buffer with a plain data.

Specified by:
handleRead in interface Filter
Overrides:
handleRead in class BaseFilter
Parameters:
ctx - Context of FilterChainContext processing.
Returns:
the next action
Throws:
IOException

handleWrite

public NextAction handleWrite(FilterChainContext ctx)
                       throws IOException
Method compresses plain data stored in FilterChainContext.getMessage() and, as the result, produces a Buffer with a GZIP compressed data.

Specified by:
handleWrite in interface Filter
Overrides:
handleWrite in class BaseFilter
Parameters:
ctx - Context of FilterChainContext processing.
Returns:
the next action
Throws:
IOException


Copyright © 2013 Oracle Corporation. All Rights Reserved.