Sdílet prostřednictvím


Buffer.Duplicate Method

Definition

Creates a new buffer that shares this buffer's content.

[Android.Runtime.Register("duplicate", "()Ljava/nio/Buffer;", "GetDuplicateHandler", ApiSince=34)]
public virtual Java.Nio.Buffer? Duplicate ();
[<Android.Runtime.Register("duplicate", "()Ljava/nio/Buffer;", "GetDuplicateHandler", ApiSince=34)>]
abstract member Duplicate : unit -> Java.Nio.Buffer
override this.Duplicate : unit -> Java.Nio.Buffer

Returns

The new buffer

Attributes

Remarks

Creates a new buffer that shares this buffer's content.

The content of the new buffer will be that of this buffer. Changes to this buffer's content will be visible in the new buffer, and vice versa; the two buffers' position, limit, and mark values will be independent.

The new buffer's capacity, limit, position and mark values will be identical to those of this buffer. The new buffer will be direct if, and only if, this buffer is direct, and it will be read-only if, and only if, this buffer is read-only.

Added in 9.

Java documentation for java.nio.Buffer.duplicate().

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