예제 #1
0
 /// <summary>
 /// Reads a 2-byte unsigned integer from the current stream and advances the position of the stream by two bytes.
 /// </summary>
 /// <param name="asLittleEndian">true to read in little-endian format; otherwise, false.</param>
 /// <returns>A 2-byte unsigned integer read from this stream.</returns>
 public ushort ReadUInt16(bool asLittleEndian) => PrimitiveConverter.ToUInt16(ReadInt16(asLittleEndian));
예제 #2
0
 /// <summary>
 /// Reads a signed byte from this stream and advances the current position of the stream by one byte.
 /// </summary>
 /// <returns>A signed byte read from the current stream.</returns>
 public sbyte ReadSByte() => PrimitiveConverter.ToSByte(ReadByte());
예제 #3
0
 /// <summary>
 /// Reads an 8-byte unsigned integer from the current stream and advances the position of the stream by eight bytes.
 /// </summary>
 /// <param name="asLittleEndian">true to read in little-endian format; otherwise, false.</param>
 /// <returns>An 8-byte unsigned integer read from this stream.</returns>
 public ulong ReadUInt64(bool asLittleEndian) => PrimitiveConverter.ToUInt64(ReadInt64(asLittleEndian));
예제 #4
0
 /// <summary>
 /// Reads a 4-byte unsigned integer from the current stream and advances the position of the stream by four bytes.
 /// </summary>
 /// <param name="asLittleEndian">true to read in little-endian format; otherwise, false.</param>
 /// <returns>A 4-byte unsigned integer read from this stream.</returns>
 public uint ReadUInt32(bool asLittleEndian) => PrimitiveConverter.ToUInt32(ReadInt32(asLittleEndian));
예제 #5
0
 /// <summary>
 /// Reads an 4-byte floating point value from the current stream and advances the current position of the stream by four bytes.
 /// </summary>
 /// <param name="asLittleEndian">true to read in little-endian format; otherwise, false.</param>
 /// <returns>An 4-byte floating point value read from the current stream.</returns>
 public float ReadSingle(bool asLittleEndian) => PrimitiveConverter.ToSingle(ReadInt32(asLittleEndian));
예제 #6
0
 /// <summary>
 /// Reads an 8-byte floating point value from the current stream and advances the current position of the stream by eight bytes.
 /// </summary>
 /// <param name="asLittleEndian">true to read in little-endian format; otherwise, false.</param>
 /// <returns>An 8-byte floating point value read from the current stream.</returns>
 public double ReadDouble(bool asLittleEndian) => PrimitiveConverter.ToDouble(ReadInt64(asLittleEndian));
예제 #7
0
 /// <summary>
 /// Writes an signed byte to the current buffer and advances the buffer position by one byte.
 /// </summary>
 /// <param name="value">The signed byte to write.</param>
 public void Write(sbyte value) => Write(PrimitiveConverter.ToByte(value));
예제 #8
0
 /// <summary>
 /// Writes an eight-byte unsigned integer to the current buffer and advances the buffer position by eight bytes.
 /// </summary>
 /// <param name="value">The eight-byte unsigned integer to write.</param>
 /// <param name="asLittleEndian">true to write in little-endian format; otherwise, false.</param>
 public void Write(ulong value, bool asLittleEndian) => Write(PrimitiveConverter.ToInt64(value), asLittleEndian);
예제 #9
0
 /// <summary>
 /// Writes a four-byte unsigned integer to the current buffer and advances the buffer position by four bytes.
 /// </summary>
 /// <param name="value">The four-byte unsigned integer to write.</param>
 /// <param name="asLittleEndian">true to write in little-endian format; otherwise, false.</param>
 public void Write(uint value, bool asLittleEndian) => Write(PrimitiveConverter.ToInt32(value), asLittleEndian);