public override LongBuffer Put(long[] src, int offset, int length) { if (((long)length << 3) > Bits.JNI_COPY_FROM_ARRAY_THRESHOLD) { CheckBounds(offset, length, src.Length); int pos = Position(); int lim = Limit(); assert(pos <= lim); int rem = (pos <= lim ? lim - pos : 0); if (length > rem) { throw new BufferOverflowException(); } if (Order() != ByteOrder.NativeOrder()) { Bits.copyFromLongArray(src, (long)offset << 3, Ix(pos), (long)length << 3); } else { Bits.CopyFromArray(src, ArrayBaseOffset, (long)offset << 3, Ix(pos), (long)length << 3); } Position(pos + length); } else { base.Put(src, offset, length); } return(this); }
public override LongBuffer Get(long[] 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); }
public override ByteOrder Order() { return((ByteOrder.NativeOrder() != ByteOrder.BIG_ENDIAN) ? ByteOrder.LITTLE_ENDIAN : ByteOrder.BIG_ENDIAN); }