/// <summary> /// Reads two-bytes unsigned value from the underlaying stream. /// </summary> /// <returns><see cref="ushort"/> read</returns> /// <exception cref="IOException">Thrown when end of stream was reached and <see cref="Unsecure"/> is false.</exception> public ushort ReadUShort() { AssertRead(2, "UShort"); return(BE ? ByteUtils.ToUShortBE(buffer) : ByteUtils.ToUShortLE(buffer)); }
/// <summary> /// Reads eight-bytes signed value from the underlaying stream. /// </summary> /// <returns><see cref="long"/> read</returns> /// <exception cref="IOException">Thrown when end of stream was reached and <see cref="Unsecure"/> is false.</exception> public long ReadLong() { AssertRead(8, "Long"); return(BE ? ByteUtils.ToLongBE(buffer) : ByteUtils.ToLongLE(buffer)); }
/// <summary> /// Reads three-bytes signed value from the underlaying stream. /// </summary> /// <returns><see cref="int"/> read</returns> /// <exception cref="IOException">Thrown when end of stream was reached and <see cref="Unsecure"/> is false.</exception> public int Read24Int() { AssertRead(3, "Int"); return(BE ? ByteUtils.To24IntBE(buffer) : ByteUtils.To24IntLE(buffer)); }
/// <summary> /// Reads two-bytes signed value from the underlaying stream. /// </summary> /// <returns><see cref="short"/> read</returns> /// <exception cref="IOException">Thrown when end of stream was reached and <see cref="Unsecure"/> is false.</exception> public short ReadShort() { AssertRead(2, "Short"); return(BE ? ByteUtils.ToShortBE(buffer) : ByteUtils.ToShortLE(buffer)); }
/// <summary> /// Reads eight-bytes unsigned value from the underlaying stream. /// </summary> /// <returns><see cref="ulong"/> read</returns> /// <exception cref="IOException">Thrown when end of stream was reached and <see cref="Unsecure"/> is false.</exception> public ulong ReadULong() { AssertRead(8, "ULong"); return(BE ? ByteUtils.ToULongBE(buffer) : ByteUtils.ToULongLE(buffer)); }
/// <summary> /// Reads four-bytes unsigned value from the underlaying stream. /// </summary> /// <returns><see cref="uint"/> read</returns> /// <exception cref="IOException">Thrown when end of stream was reached and <see cref="Unsecure"/> is false.</exception> public uint ReadUInt() { AssertRead(4, "UInt"); return(BE ? ByteUtils.ToUIntBE(buffer) : ByteUtils.ToUIntLE(buffer)); }