Code example for CRC32

Methods: getValueupdate

0
    { 
        if (header == null) {
            ByteBuffer buf = ByteBuffer.allocate(5);
            buf.put((byte) 0);
 
            CRC32 crc = new CRC32();
            crc.update(data);
            buf.putInt((int) (0xffffffffL & crc.getValue()));
 
            header = buf.array();
        } 
        return header;
    } 
 
    public byte[] getPayload() 
    { 
        return data;
    } 
 
    public long validBytes() 
Stop searching for code, let great code find you!  Add Codota to your java IDE