Class ZlibDecoder

    • Field Summary

      Fields 
      Modifier and Type Field Description
      private byte[] dictionary  
      private boolean finished  
      private com.jcraft.jzlib.ZStream z  
    • Constructor Summary

      Constructors 
      Constructor Description
      ZlibDecoder()
      Creates a new instance with the default wrapper (ZlibWrapper.ZLIB).
      ZlibDecoder​(byte[] dictionary)
      Creates a new instance with the specified preset dictionary.
      ZlibDecoder​(ZlibWrapper wrapper)
      Creates a new instance with the specified wrapper.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected java.lang.Object decode​(ChannelHandlerContext ctx, Channel channel, java.lang.Object msg)
      Transforms the specified received message into another message and return the transformed message.
      boolean isClosed()
      Returns true if and only if the end of the compressed stream has been reached.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • z

        private final com.jcraft.jzlib.ZStream z
      • dictionary

        private byte[] dictionary
      • finished

        private volatile boolean finished
    • Constructor Detail

      • ZlibDecoder

        public ZlibDecoder​(ZlibWrapper wrapper)
        Creates a new instance with the specified wrapper.
        Throws:
        CompressionException - if failed to initialize zlib
      • ZlibDecoder

        public ZlibDecoder​(byte[] dictionary)
        Creates a new instance with the specified preset dictionary. The wrapper is always ZlibWrapper.ZLIB because it is the only format that supports the preset dictionary.
        Throws:
        CompressionException - if failed to initialize zlib
    • Method Detail

      • isClosed

        public boolean isClosed()
        Returns true if and only if the end of the compressed stream has been reached.
      • decode

        protected java.lang.Object decode​(ChannelHandlerContext ctx,
                                          Channel channel,
                                          java.lang.Object msg)
                                   throws java.lang.Exception
        Description copied from class: OneToOneDecoder
        Transforms the specified received message into another message and return the transformed message. Return null if the received message is supposed to be discarded.
        Specified by:
        decode in class OneToOneDecoder
        Throws:
        java.lang.Exception