public UInt16 ReadShort()
{
byte[] dataLegthBytes = new byte[2];
if (Stream.CanSeek && Stream.Length - Stream.Position < dataLegthBytes.Length)
{
throw new Exception("Not enough data");
}
Stream.Read(dataLegthBytes, 0, dataLegthBytes.Length);
return (ushort)((dataLegthBytes[0] << 8) + dataLegthBytes[1]);
}