long getSum(int offset, int len) {
        long sum = 0;
        while (len > 1) {
            sum += readShort(offset) & 0xFFFF;
            offset += 2;
            len -= 2;
        }

        if (len > 0) {
            sum += (packet[offset] & 0xFF) << 8;
        }
        return sum;
    }
An abstract header object for ip protocol packets, provides some common apis.

@author Megatron King
@since 2018-10-09 16:28
netbare-core/src/main/java/com/github/megatronking/netbare/ip/Header.java