private int parseTrailer(byte[] input, int inOffset, List<WsByteBuffer> list) throws DataFormatException {
        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
            Tr.debug(tc, "Parsing trailer, offset=" + this.parseOffset + " val=" + this.parseInt);
        }
        int offset = inOffset;
        long val = 0L;
        // bytes are in lowest order first
        while (8 > this.parseOffset && offset < input.length) {
            switch (this.parseOffset) {
                // even bytes are just going to save the first byte of an int
                case 0:
                case 2:
                case 4:
                case 6:
                    this.parseFirstByte = input[offset] & 0xff;
                    break;
                // bytes 1 and 5 are the 2nd byte of that int
                case 1:
                case 5:
                    this.parseInt = ((input[offset] & 0xff) << 8) | this.parseFirstByte;
                    break;
                // 3 and 7 mark the final bytes of the 2 int values
                case 3:
                    // reached the end of the checksum int
                    val = ((input[offset] & 0xff) << 8) | this.parseFirstByte;
                    val = (val << 16) | this.parseInt;
                    if (this.checksum.getValue() != val) {
                        String msg = "Checksum does not match; crc=" + this.checksum.getValue() + " trailer=" + val;
                        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                            Tr.debug(tc, msg);
                        }
                        release(list);
                        throw new DataFormatException(msg);
                    }
                    break;
                case 7:
                    // reached the end of the "num bytes" int
                    val = ((input[offset] & 0xff) << 8) | this.parseFirstByte;
                    val = (val << 16) | this.parseInt;
                    if (this.inflater.getBytesWritten() != val) {
                        String msg = "BytesWritten does not match; inflater=" + this.inflater.getBytesWritten() + " trailer=" + val;
                        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                            Tr.debug(tc, msg);
                        }
                        release(list);
                        throw new DataFormatException(msg);
                    }

                    // having fully parsed the trailer, if we are going to re-enter decompression, then we need to reset
                    this.resetNeededToProceed = true;

                    break;
                default:
                    break;
            }
            offset++;
            this.parseOffset++;
        }
        return offset;
    }
private int parseTrailer ( byte [ ] input , int inOffset , List < WsByteBuffer > list ) throws DataFormatException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "Parsing trailer, offset=" + this . parseOffset + " val=" + this . parseInt ) ; } int offset = inOffset ; long val = 0L ; while ( 8 > this . parseOffset && offset < input . length ) { switch ( this . parseOffset ) { case 0 : case 2 : case 4 : case 6 : this . parseFirstByte = input [ offset ] & 0xff ; break ; case 1 : case 5 : this . parseInt = ( ( input [ offset ] & 0xff ) << 8 ) | this . parseFirstByte ; break ; case 3 : val = ( ( input [ offset ] & 0xff ) << 8 ) | this . parseFirstByte ; val = ( val << 16 ) | this . parseInt ; if ( this . checksum . getValue ( ) != val ) { String msg = "Checksum does not match; crc=" + this . checksum . getValue ( ) + " trailer=" + val ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , msg ) ; } release ( list ) ; throw new DataFormatException ( msg ) ; } break ; case 7 : val = ( ( input [ offset ] & 0xff ) << 8 ) | this . parseFirstByte ; val = ( val << 16 ) | this . parseInt ; if ( this . inflater . getBytesWritten ( ) != val ) { String msg = "BytesWritten does not match; inflater=" + this . inflater . getBytesWritten ( ) + " trailer=" + val ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , msg ) ; } release ( list ) ; throw new DataFormatException ( msg ) ; } this . resetNeededToProceed = true ; break ; default : break ; } offset ++ ; this . parseOffset ++ ; } return offset ; }
Parse past the GZIP trailer information. This is the two ints for the CRC32
checksum validation.

@param input
@param inOffset
@param list
@return new offset
@throws DataFormatException
- if the trailer data is wrong