src/net/java/sip/communicator/impl/packetlogging/PacketLoggingServiceImpl.java
/**
     * Calculates checksums assuming the checksum is a 16-bit header field.
     */
Calculates checksums assuming the checksum is a 16-bit header field.
Calculates checksums assuming the checksum is a 16 - bit header field .
private int computeChecksum(byte[] data)
    {
        int total = 0;
        int i = 0;
        int imax = data.length - (data.length % 2);
        while(i < imax)
            total+=(((data[i++] & 0xff) << 8) | (data[i++] & 0xff));
        if(i < data.length)
            total+=((data[i] & 0xff) << 8);
        while((total & 0xffff0000) != 0)
            total = (total & 0xffff) + (total >>> 16);
        total = (~total & 0xffff);
        return total;
    }
private int computeChecksum ( byte [ ] data ) { int total = 0 ; int i = 0 ; int imax = data . length - ( data . length % 2 ) ; while ( i < imax ) total += ( ( ( data [ i ++ ] & 0xff ) << 8 ) | ( data [ i ++ ] & 0xff ) ) ; if ( i < data . length ) total += ( ( data [ i ] & 0xff ) << 8 ) ; while ( ( total & 0xffff0000 ) != 0 ) total = ( total & 0xffff ) + ( total >>> 16 ) ; total = ( ~ total & 0xffff ) ; return total ; }
Calculates checksums assuming the checksum is a 16-bit header field.
Calculates checksums assuming the checksum is a 16 - bit header field .
// Don't Skip existing checksum cause its set to 0000 // Fold to 16 bits