コード例 #1
0
 /// <summary>
 /// Reads a float value from the stream in little endian byte order
 /// </summary>
 /// <returns>The value read</returns>
 /// <remarks>This throws if the data isn't available</remarks>
 public float ReadSingleLE()
 {
     return(!BitConverter.IsLittleEndian ? ByteOrderUtility.Swap(ReadSingle()) : ReadSingle());
 }
コード例 #2
0
 /// <summary>
 /// Reads a double value from the stream in little endian byte order
 /// </summary>
 /// <returns>The value read</returns>
 /// <remarks>This throws if the data isn't available</remarks>
 public double ReadDoubleLE()
 {
     return(!BitConverter.IsLittleEndian ? ByteOrderUtility.Swap(ReadDouble()) : ReadDouble());
 }
コード例 #3
0
 /// <summary>
 /// Reads an Int64 value from the stream in big endian byte order
 /// </summary>
 /// <returns>The value read</returns>
 /// <remarks>This throws if the data isn't available</remarks>
 public long ReadInt64BE()
 {
     return(BitConverter.IsLittleEndian ? ByteOrderUtility.Swap(ReadInt64()) : ReadInt64());
 }
コード例 #4
0
 /// <summary>
 /// Reads a UInt64 value from the stream in little endian byte order
 /// </summary>
 /// <returns>The value read</returns>
 /// <remarks>This throws if the data isn't available</remarks>
 public ulong ReadUInt64LE()
 {
     return(!BitConverter.IsLittleEndian ? ByteOrderUtility.Swap(ReadUInt64()) : ReadUInt64());
 }
コード例 #5
0
 /// <summary>
 /// Reads an Int32 value from the stream in big endian byte order
 /// </summary>
 /// <returns>The value read</returns>
 /// <remarks>This throws if the data isn't available</remarks>
 public int ReadInt32BE()
 {
     return(BitConverter.IsLittleEndian ? ByteOrderUtility.Swap(ReadInt32()) : ReadInt32());
 }
コード例 #6
0
 /// <summary>
 /// Reads a UInt32 value from the stream in little endian byte order
 /// </summary>
 /// <returns>The value read</returns>
 /// <remarks>This throws if the data isn't available</remarks>
 public uint ReadUInt32LE()
 {
     return(!BitConverter.IsLittleEndian ? ByteOrderUtility.Swap(ReadUInt32()) : ReadUInt32());
 }
コード例 #7
0
 /// <summary>
 /// Reads an Int16 value from the stream in big endian byte order
 /// </summary>
 /// <returns>The value read</returns>
 /// <remarks>This throws if the data isn't available</remarks>
 public short ReadInt16BE()
 {
     return(BitConverter.IsLittleEndian?ByteOrderUtility.Swap(ReadInt16()): ReadInt16());
 }
コード例 #8
0
 /// <summary>
 /// Reads a UInt16 value from the stream in little endian byte order
 /// </summary>
 /// <returns>The value read</returns>
 /// <remarks>This throws if the data isn't available</remarks>
 public ushort ReadUInt16LE()
 {
     return(!BitConverter.IsLittleEndian ? ByteOrderUtility.Swap(ReadUInt16()) : ReadUInt16());
 }
コード例 #9
0
 /// <summary>
 /// Writes a signed 16-bit integer to the output stream in big-endian byte order
 /// </summary>
 /// <param name="value">The value to write</param>
 public void WriteInt16BE(short value)
 {
     WriteBytes(BitConverter.GetBytes(BitConverter.IsLittleEndian?ByteOrderUtility.Swap(value):value));
 }
コード例 #10
0
 /// <summary>
 /// Writes a 64-bit floating point value to the output stream in little-endian byte order
 /// </summary>
 /// <param name="value">The value to write</param>
 public void WriteDoubleLE(double value)
 {
     WriteBytes(BitConverter.GetBytes(!BitConverter.IsLittleEndian ? ByteOrderUtility.Swap(value) : value));
 }
コード例 #11
0
 /// <summary>
 /// Writes a 32-bit floating point value to the output stream in big-endian byte order
 /// </summary>
 /// <param name="value">The value to write</param>
 public void WriteSingleBE(float value)
 {
     WriteBytes(BitConverter.GetBytes(BitConverter.IsLittleEndian ? ByteOrderUtility.Swap(value) : value));
 }
コード例 #12
0
 /// <summary>
 /// Writes a unsigned 64-bit integer to the output stream in little-endian byte order
 /// </summary>
 /// <param name="value">The value to write</param>
 public void WriteUInt64LE(ulong value)
 {
     WriteBytes(BitConverter.GetBytes(!BitConverter.IsLittleEndian ? ByteOrderUtility.Swap(value) : value));
 }
コード例 #13
0
 /// <summary>
 /// Writes a unsigned 32-bit integer to the output stream in big-endian byte order
 /// </summary>
 /// <param name="value">The value to write</param>
 public void WriteUInt32BE(uint value)
 {
     WriteBytes(BitConverter.GetBytes(BitConverter.IsLittleEndian ? ByteOrderUtility.Swap(value) : value));
 }