/** Writes longs from the given long array to the current position and increases the position by the number of longs written. * <p> * Calling this method has the same effect as {@code put(src, 0, src.length)}. * </p> * * @param src the source long array. * @return this buffer. * @exception BufferOverflowException if {@code remaining()} is less than {@code src.length}. * @exception ReadOnlyBufferException if no changes may be made to the contents of this buffer. * @since Android 1.0 */ public final LongBuffer put (long[] src) { return put(src, 0, src.length); }
/** Writes longs from the given long array to the current position and increases the position by the number of longs written. * <p> * Calling this method has the same effect as {@code put(src, 0, src.length)}. * </p> * * @param src the source long array. * @return this buffer. * @exception BufferOverflowException if {@code remaining()} is less than {@code src.length}. * @exception ReadOnlyBufferException if no changes may be made to the contents of this buffer. * @since Android 1.0 */ public final LongBuffer put (long[] src) { return put(src, 0, src.length); }
@Override public LongIndexer put(long i, long j, long[] l, int offset, int length) { for (int n = 0; n < length; n++) { buffer.put((int)i * (int)strides[0] + (int)j * (int)strides[1] + n, l[offset + n]); } return this; } @Override public LongIndexer put(long i, long j, long k, long l) {
@Override public LongIndexer put(long i, long l) { buffer.put((int)i, l); return this; } @Override public LongIndexer put(long i, long[] l, int offset, int length) {
@Override public LongIndexer put(long i, long[] l, int offset, int length) { for (int n = 0; n < length; n++) { buffer.put((int)i * (int)strides[0] + n, l[offset + n]); } return this; } @Override public LongIndexer put(long i, long j, long l) {
@Override public LongIndexer put(long i, long j, long k, long l) { buffer.put((int)i * (int)strides[0] + (int)j * (int)strides[1] + (int)k, l); return this; } @Override public LongIndexer put(long[] indices, long l) {
@Override public LongIndexer put(long i, long j, long l) { buffer.put((int)i * (int)strides[0] + (int)j, l); return this; } @Override public LongIndexer put(long i, long j, long[] l, int offset, int length) {
@Override public void init(ByteBuffer buf, int position) { ByteBuffer mutationBuffer = buf.duplicate(); mutationBuffer.position(position); final long[] bins = new long[breaks.length + 1]; mutationBuffer.asLongBuffer().put(bins); mutationBuffer.putFloat(position + minOffset, Float.POSITIVE_INFINITY); mutationBuffer.putFloat(position + maxOffset, Float.NEGATIVE_INFINITY); }
@Override public void glGetBufferParameteri64v (int target, int pname, LongBuffer params) { params.put(GL32.glGetBufferParameteri64(target, pname)); }
@Override public void glGetBufferParameteri64v (int target, int pname, LongBuffer params) { params.put(GL32.glGetBufferParameteri64(target, pname)); }
@Override public void glGetBufferParameteri64v (int target, int pname, LongBuffer params) { params.put(GL32.glGetBufferParameteri64(target, pname)); }
@Override public void glGetBufferParameteri64v (int target, int pname, LongBuffer params) { params.put(GL32.glGetBufferParameteri64(target, pname)); }
/** * Writes the dense representation of this ApproximateHistogram object to the given byte-buffer * * Requires 16 + 12 * size bytes of storage * * @param buf ByteBuffer to write the ApproximateHistogram to */ public void toBytesDense(ByteBuffer buf) { buf.putInt(size); buf.putInt(binCount); buf.asFloatBuffer().put(positions); buf.position(buf.position() + Float.BYTES * positions.length); buf.asLongBuffer().put(bins); buf.position(buf.position() + Long.BYTES * bins.length); buf.putFloat(min); buf.putFloat(max); }
@Override public LongIndexer put(long[] indices, long[] l, int offset, int length) { for (int n = 0; n < length; n++) { buffer.put((int)index(indices) + n, l[offset + n]); } return this; }
@Override public LongIndexer put(long[] indices, long l) { buffer.put((int)index(indices), l); return this; } @Override public LongIndexer put(long[] indices, long[] l, int offset, int length) {
/** * Helper method for toBytesFull * * @param buf Destination buffer * @param withHeader If true, include the serialization header */ private void writeByteBufferFull(ByteBuffer buf, boolean withHeader) { if (withHeader) { writeByteBufferSerdeHeader(buf, FULL_ENCODING_MODE); } writeByteBufferCommonFields(buf); buf.asLongBuffer().put(histogram); buf.position(buf.position() + Long.BYTES * histogram.length); }
/** Writes longs from the given long array, starting from the specified offset, to the current position and increases the * position by the number of longs written. * * @param src the source long array. * @param off the offset of long array, must not be negative and not greater than {@code src.length}. * @param len the number of longs to write, must be no less than zero and not greater than {@code src.length - off}. * @return this buffer. * @exception BufferOverflowException if {@code remaining()} is less than {@code len}. * @exception IndexOutOfBoundsException if either {@code off} or {@code len} is invalid. * @exception ReadOnlyBufferException if no changes may be made to the contents of this buffer. * @since Android 1.0 */ public LongBuffer put (long[] src, int off, int len) { int length = src.length; if (off < 0 || len < 0 || (long)len + (long)off > length) { throw new IndexOutOfBoundsException(); } if (len > remaining()) { throw new BufferOverflowException(); } for (int i = off; i < off + len; i++) { put(src[i]); } return this; }
/** Writes longs from the given long array, starting from the specified offset, to the current position and increases the * position by the number of longs written. * * @param src the source long array. * @param off the offset of long array, must not be negative and not greater than {@code src.length}. * @param len the number of longs to write, must be no less than zero and not greater than {@code src.length - off}. * @return this buffer. * @exception BufferOverflowException if {@code remaining()} is less than {@code len}. * @exception IndexOutOfBoundsException if either {@code off} or {@code len} is invalid. * @exception ReadOnlyBufferException if no changes may be made to the contents of this buffer. * @since Android 1.0 */ public LongBuffer put (long[] src, int off, int len) { int length = src.length; if (off < 0 || len < 0 || (long)len + (long)off > length) { throw new IndexOutOfBoundsException(); } if (len > remaining()) { throw new BufferOverflowException(); } for (int i = off; i < off + len; i++) { put(src[i]); } return this; }
/** Writes all the remaining longs of the {@code src} long buffer to this buffer's current position, and increases both buffers' * position by the number of longs copied. * * @param src the source long buffer. * @return this buffer. * @exception BufferOverflowException if {@code src.remaining()} is greater than this buffer's {@code remaining()}. * @exception IllegalArgumentException if {@code src} is this buffer. * @exception ReadOnlyBufferException if no changes may be made to the contents of this buffer. * @since Android 1.0 */ public LongBuffer put (LongBuffer src) { if (src == this) { throw new IllegalArgumentException(); } if (src.remaining() > remaining()) { throw new BufferOverflowException(); } long[] contents = new long[src.remaining()]; src.get(contents); put(contents); return this; }
/** Writes all the remaining longs of the {@code src} long buffer to this buffer's current position, and increases both buffers' * position by the number of longs copied. * * @param src the source long buffer. * @return this buffer. * @exception BufferOverflowException if {@code src.remaining()} is greater than this buffer's {@code remaining()}. * @exception IllegalArgumentException if {@code src} is this buffer. * @exception ReadOnlyBufferException if no changes may be made to the contents of this buffer. * @since Android 1.0 */ public LongBuffer put (LongBuffer src) { if (src == this) { throw new IllegalArgumentException(); } if (src.remaining() > remaining()) { throw new BufferOverflowException(); } long[] contents = new long[src.remaining()]; src.get(contents); put(contents); return this; }