public static int Write(this Stream stream, float value)
 {
     if (!BitConverter.IsLittleEndian)
     {
         value = DereToreHelper.SwapEndian(value);
     }
     stream.Write(BitConverter.GetBytes(value), 0, 4);
     return(4);
 }
 public override void Write(uint value)
 {
     if (Endian != SystemEndian.Type)
     {
         value = DereToreHelper.SwapEndian(value);
         base.Write(value);
     }
     else
     {
         base.Write(value);
     }
 }
Exemple #3
0
 public override uint ReadUInt32()
 {
     if (Endian != SystemEndian.Type)
     {
         var value = base.ReadUInt32();
         value = DereToreHelper.SwapEndian(value);
         return(value);
     }
     else
     {
         return(base.ReadUInt32());
     }
 }
Exemple #4
0
 public override float ReadSingle()
 {
     if (Endian != SystemEndian.Type)
     {
         var value = base.ReadSingle();
         value = DereToreHelper.SwapEndian(value);
         return(value);
     }
     else
     {
         return(base.ReadSingle());
     }
 }
Exemple #5
0
        public static int Write(this byte[] array, uint value, int index)
        {
            if (!BitConverter.IsLittleEndian)
            {
                value = DereToreHelper.SwapEndian(value);
            }
            var bytes = BitConverter.GetBytes(value);

            for (var i = 0; i < 4; ++i)
            {
                array[index + i] = bytes[i];
            }
            return(4);
        }