private ushort CalculateChecksum()
 {
     return(GreDatagram.CalculateChecksum(this.Buffer, this.StartOffset, this.Length));
 }
        internal static void WriteChecksum(byte[] buffer, int offset, int length, ushort?checksum)
        {
            ushort?nullable = checksum;
            ushort num      = !(nullable.HasValue ? new int?((int)nullable.GetValueOrDefault()) : new int?()).HasValue ? GreDatagram.CalculateChecksum(buffer, offset, length) : checksum.Value;

            ByteArrayExtensions.Write(buffer, offset + 4, num, Endianity.Big);
        }