OpenBve.WaveParser.ReadUInt16 C# (CSharp) Méthode

ReadUInt16() private static méthode

Reads a System.UInt16 from a binary reader with the specified endianness.
The stream is closed. An I/O error occurs. The end of the stream is reached.
private static ReadUInt16 ( BinaryReader reader, Endianness endianness ) : ushort
reader System.IO.BinaryReader The binary reader.
endianness Endianness The endianness.
Résultat ushort
		private static ushort ReadUInt16(BinaryReader reader, Endianness endianness) {
			ushort value = reader.ReadUInt16();
			if (endianness == Endianness.Big) {
				unchecked {
					return (ushort)(((uint)value << 8) | ((uint)value >> 8));
				}
			} else {
				return value;
			}
		}