Example #1
0
        public static void WriteValueU32(this Stream stream, UInt32 value, Endian endian)
        {
            if (ShouldSwap(endian))
            {
                value = value.Swap();
            }

            var data = BitConverter.GetBytes(value);
            Debug.Assert(data.Length == 4);
            stream.WriteBytes(data);
        }
Example #2
0
        public static void WriteValueU32(this Stream stream, UInt32 value, bool littleEndian)
        {
            if (ShouldSwap(littleEndian))
            {
                value = value.Swap();
            }

            byte[] data = BitConverter.GetBytes(value);
            Debug.Assert(data.Length == 4);
            stream.Write(data, 0, 4);
        }
Example #3
0
 public static void WriteU32BE(this Stream stream, UInt32 value)
 {
     byte[] data = BitConverter.GetBytes(value.Swap());
     stream.Write(data, 0, 4);
 }