LongBuffer.Put Method

Definition

Overloads

Put(LongBuffer)

Relative bulk put method  (optional operation).

Put(Int64)

Relative put method  (optional operation).

Put(Int64[])

Relative bulk put method  (optional operation).

Put(Int32, Int64)

Absolute put method  (optional operation).

Put(Int64[], Int32, Int32)

Relative bulk put method  (optional operation).

Put(LongBuffer)

Relative bulk put method  (optional operation).

[Android.Runtime.Register("put", "(Ljava/nio/LongBuffer;)Ljava/nio/LongBuffer;", "GetPut_Ljava_nio_LongBuffer_Handler")]
public virtual Java.Nio.LongBuffer? Put (Java.Nio.LongBuffer? src);
[<Android.Runtime.Register("put", "(Ljava/nio/LongBuffer;)Ljava/nio/LongBuffer;", "GetPut_Ljava_nio_LongBuffer_Handler")>]
abstract member Put : Java.Nio.LongBuffer -> Java.Nio.LongBuffer
override this.Put : Java.Nio.LongBuffer -> Java.Nio.LongBuffer

Parameters

src
LongBuffer

The source buffer from which longs are to be read; must not be this buffer

Returns

This buffer

Attributes

Exceptions

if src.remaining() is greater than this buffer's remaining().

if src is this buffer.

if no changes may be made to the contents of this buffer.

Remarks

Relative bulk put method&nbsp;&nbsp;(optional operation).

This method transfers the longs remaining in the given source buffer into this buffer. If there are more longs remaining in the source buffer than in this buffer, that is, if src.remaining()&nbsp;&gt;&nbsp;remaining(), then no longs are transferred and a BufferOverflowException is thrown.

Otherwise, this method copies n&nbsp;=&nbsp;src.remaining() longs from the given buffer into this buffer, starting at each buffer's current position. The positions of both buffers are then incremented by n.

In other words, an invocation of this method of the form dst.put(src) has exactly the same effect as the loop

while (src.hasRemaining())
                    dst.put(src.get()); 

except that it first checks that there is sufficient space in this buffer and it is potentially much more efficient.

Java documentation for java.nio.LongBuffer.put(java.nio.LongBuffer).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to

Put(Int64)

Relative put method&nbsp;&nbsp;(optional operation).

[Android.Runtime.Register("put", "(J)Ljava/nio/LongBuffer;", "GetPut_JHandler")]
public abstract Java.Nio.LongBuffer? Put (long l);
[<Android.Runtime.Register("put", "(J)Ljava/nio/LongBuffer;", "GetPut_JHandler")>]
abstract member Put : int64 -> Java.Nio.LongBuffer

Parameters

l
Int64

The long to be written

Returns

This buffer

Attributes

Exceptions

if position is equal or greater than limit.

if no changes may be made to the contents of this buffer.

Remarks

Relative put method&nbsp;&nbsp;(optional operation).

Writes the given long into this buffer at the current position, and then increments the position.

Java documentation for java.nio.LongBuffer.put(long).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to

Put(Int64[])

Relative bulk put method&nbsp;&nbsp;(optional operation).

[Android.Runtime.Register("put", "([J)Ljava/nio/LongBuffer;", "")]
public Java.Nio.LongBuffer? Put (long[]? src);
[<Android.Runtime.Register("put", "([J)Ljava/nio/LongBuffer;", "")>]
member this.Put : int64[] -> Java.Nio.LongBuffer

Parameters

src
Int64[]

The source array

Returns

This buffer

Attributes

Exceptions

if remaining() is less than src.length.

if no changes may be made to the contents of this buffer.

Remarks

Relative bulk put method&nbsp;&nbsp;(optional operation).

This method transfers the entire content of the given source long array into this buffer. An invocation of this method of the form dst.put(a) behaves in exactly the same way as the invocation

dst.put(a, 0, a.length)

Java documentation for java.nio.LongBuffer.put(long[]).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to

Put(Int32, Int64)

Absolute put method&nbsp;&nbsp;(optional operation).

[Android.Runtime.Register("put", "(IJ)Ljava/nio/LongBuffer;", "GetPut_IJHandler")]
public abstract Java.Nio.LongBuffer? Put (int index, long l);
[<Android.Runtime.Register("put", "(IJ)Ljava/nio/LongBuffer;", "GetPut_IJHandler")>]
abstract member Put : int * int64 -> Java.Nio.LongBuffer

Parameters

index
Int32

The index at which the long will be written

l
Int64

The long value to be written

Returns

This buffer

Attributes

Exceptions

if index is invalid.

if no changes may be made to the contents of this buffer.

Remarks

Absolute put method&nbsp;&nbsp;(optional operation).

Writes the given long into this buffer at the given index.

Java documentation for java.nio.LongBuffer.put(int, long).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to

Put(Int64[], Int32, Int32)

Relative bulk put method&nbsp;&nbsp;(optional operation).

[Android.Runtime.Register("put", "([JII)Ljava/nio/LongBuffer;", "GetPut_arrayJIIHandler")]
public virtual Java.Nio.LongBuffer? Put (long[]? src, int offset, int length);
[<Android.Runtime.Register("put", "([JII)Ljava/nio/LongBuffer;", "GetPut_arrayJIIHandler")>]
abstract member Put : int64[] * int * int -> Java.Nio.LongBuffer
override this.Put : int64[] * int * int -> Java.Nio.LongBuffer

Parameters

src
Int64[]

The array from which longs are to be read

offset
Int32

The offset within the array of the first long to be read; must be non-negative and no larger than array.length

length
Int32

The number of longs to be read from the given array; must be non-negative and no larger than array.length - offset

Returns

This buffer

Attributes

Exceptions

if remaining() is less than longCount.

if either srcOffset or longCount is invalid.

if no changes may be made to the contents of this buffer.

Remarks

Relative bulk put method&nbsp;&nbsp;(optional operation).

This method transfers longs into this buffer from the given source array. If there are more longs to be copied from the array than remain in this buffer, that is, if length&nbsp;&gt;&nbsp;remaining(), then no longs are transferred and a BufferOverflowException is thrown.

Otherwise, this method copies length longs from the given array into this buffer, starting at the given offset in the array and at the current position of this buffer. The position of this buffer is then incremented by length.

In other words, an invocation of this method of the form dst.put(src,&nbsp;off,&nbsp;len) has exactly the same effect as the loop

{@code
                for (int i = off; i < off + len; i++)
                    dst.put(a[i]);
            }

except that it first checks that there is sufficient space in this buffer and it is potentially much more efficient.

Java documentation for java.nio.LongBuffer.put(long[], int, int).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to