Ejemplo n.º 1
0
        public int Read(double[] buffer, int index, int count)
        {
            int byteIndex = 0;
            int byteCount = count * sizeof(double);
            int first     = index;
            int last      = index + count;

            while (index < last)
            {
                int left   = byteCount - byteIndex;
                int toRead = left < BufferSize ? left : BufferSize;
                int read   = Read(m_buffer, 0, toRead);
                for (int i = 0; i < read; i += sizeof(double), index++)
                {
                    buffer[index] = BitConverterExtensions.ToDouble(BufferToUInt64(i));
                }
                byteIndex += read;
                if (read < toRead)
                {
                    return(index - first);
                }
            }
            return(count);
        }
Ejemplo n.º 2
0
 public override double ReadDouble()
 {
     FillInnerBuffer(sizeof(double));
     return(BitConverterExtensions.ToDouble(BufferToUInt64()));
 }