/// <summary> /// Reads a ushort from the underlying stream. /// </summary> /// <returns>A ushort.</returns> public ushort ReadUShort() { lock (m_Reader) { if (Endian.IsBigEndian != m_IsBigEndian) { return(Endian.SwapUInt16(m_Reader.ReadUInt16())); } return(m_Reader.ReadUInt16()); } }
/// <summary> /// Writes a short to the underlying stream. /// </summary> public void WriteUInt16(ushort Val) { lock (m_Writer) { if (Endian.IsBigEndian != m_IsBigEndian) { Endian.SwapUInt16(Val); m_Writer.Write(Val); return; } m_Writer.Write(Val); } }