Exemplo n.º 1
0
        public override DoubleBuffer Get(double[] dst, int offset, int length)
        {
            if (((long)length << 3) > Bits.JNI_COPY_TO_ARRAY_THRESHOLD)
            {
                CheckBounds(offset, length, dst.Length);
                int pos = Position();
                int lim = Limit();
                assert(pos <= lim);
                int rem = (pos <= lim ? lim - pos : 0);
                if (length > rem)
                {
                    throw new BufferUnderflowException();
                }


                if (Order() != ByteOrder.NativeOrder())
                {
                    Bits.copyToLongArray(Ix(pos), dst, (long)offset << 3, (long)length << 3);
                }
                else

                {
                    Bits.CopyToArray(Ix(pos), dst, ArrayBaseOffset, (long)offset << 3, (long)length << 3);
                }
                Position(pos + length);
            }
            else
            {
                base.Get(dst, offset, length);
            }
            return(this);
        }