Пример #1
0
        public static double ReadBufferDouble(byte[] buffer, int bufferOffset)
        {
            var doubleBuffer = new byte[8];

            Buffer.BlockCopy(buffer, bufferOffset, doubleBuffer, 0, 8);
            return(LittleEndianByteOrder.GetDouble(doubleBuffer));
        }
Пример #2
0
        public static double ExpectDouble(this Stream target)
        {
            var buff = new byte[8];

            if (target.Read(buff) == 8)
            {
                return(LittleEndianByteOrder.GetDouble(buff));
            }
            else
            {
                throw new EndOfStreamException();
            }
        }