Пример #1
0
        public float ReadSingle()
        {
            var bytes = new byte[sizeof(float)];

            _stream.Read(bytes, 0, sizeof(float));
            return(EndianAwareBitConverter.ToSingle(bytes, Endianness));
        }
Пример #2
0
        public long ReadInt64()
        {
            var bytes = new byte[sizeof(long)];

            _stream.Read(bytes, 0, sizeof(long));
            return(EndianAwareBitConverter.ToInt64(bytes, Endianness));
        }
Пример #3
0
        public int ReadInt32()
        {
            var bytes = new byte[sizeof(int)];

            _stream.Read(bytes, 0, sizeof(int));
            return(EndianAwareBitConverter.ToInt32(bytes, Endianness));
        }
Пример #4
0
        public short ReadInt16()
        {
            var bytes = new byte[sizeof(short)];

            _stream.Read(bytes, 0, sizeof(short));
            return(EndianAwareBitConverter.ToInt16(bytes, Endianness));
        }
Пример #5
0
        public double ReadDouble()
        {
            var bytes = new byte[sizeof(double)];

            _stream.Read(bytes, 0, sizeof(double));
            return(EndianAwareBitConverter.ToDouble(bytes, Endianness));
        }
Пример #6
0
        public void WriteDouble(double value)
        {
            var bytes = EndianAwareBitConverter.GetBytes(value, Endianness);

            _stream.Write(bytes, 0, bytes.Length);
        }