Exemplo n.º 1
0
        public static void WriteValueS32(this Stream stream, Int32 value, Endian endian)
        {
            if (ShouldSwap(endian) == true)
            {
                value = value.Swap();
            }

            var data = BitConverter.GetBytes(value);
            Debug.Assert(data.Length == 4);
            stream.WriteBytes(data);
        }
Exemplo n.º 2
0
        public static void WriteValueS32(this Stream stream, Int32 value, bool littleEndian)
        {
            if (ShouldSwap(littleEndian))
            {
                value = value.Swap();
            }

            byte[] data = BitConverter.GetBytes(value);
            Debug.Assert(data.Length == 4);
            stream.Write(data, 0, 4);
        }
Exemplo n.º 3
0
 public static void WriteS32BE(this Stream stream, Int32 value)
 {
     byte[] data = BitConverter.GetBytes(value.Swap());
     stream.Write(data, 0, 4);
 }