예제 #1
0
파일: S16.cs 프로젝트: nortex/d3sharp
        public static void WriteValueS16(this Stream stream, Int16 value, bool littleEndian)
        {
            if (ShouldSwap(littleEndian))
            {
                value = value.Swap();
            }

            byte[] data = BitConverter.GetBytes(value);
            Debug.Assert(data.Length == 2);
            stream.Write(data, 0, 2);
        }
예제 #2
0
파일: S16.cs 프로젝트: Juvidoh/me3-lazarus
        public static void WriteValueS16(this Stream stream, Int16 value, Endian endian)
        {
            if (ShouldSwap(endian))
            {
                value = value.Swap();
            }

            var data = BitConverter.GetBytes(value);
            Debug.Assert(data.Length == 2);
            stream.WriteBytes(data);
        }
예제 #3
0
 public static void WriteS16BE(this Stream stream, Int16 value)
 {
     byte[] data = BitConverter.GetBytes(value.Swap());
     stream.Write(data, 0, 2);
 }