public static ushort ReadUShort(this byte[] buffer, ref int offset, Endianity endianity)
        {
            ushort num = ByteArrayExtensions.ReadUShort(buffer, offset, endianity);

            offset += 2;
            return(num);
        }
Example #2
0
        protected static uint Sum16Bits(byte[] buffer, int offset, int length)
        {
            if (buffer == null)
            {
                throw new ArgumentNullException("buffer");
            }
            int  num1 = offset + length;
            uint num2 = 0U;

            while (offset < num1 - 1)
            {
                num2 += (uint)ByteArrayExtensions.ReadUShort(buffer, ref offset, Endianity.Big);
            }
            if (offset < num1)
            {
                num2 += (uint)(ushort)((uint)buffer[offset] << 8);
            }
            return(num2);
        }
Example #3
0
 internal ushort ReadUShort(int offset, Endianity endianity)
 {
     return(ByteArrayExtensions.ReadUShort(this.Buffer, this.StartOffset + offset, endianity));
 }