다음을 통해 공유


CharBuffer.Slice Method

Definition

Overloads

Slice()

Creates a new char buffer whose content is a shared subsequence of this buffer's content.

Slice(Int32, Int32)

Creates a new char buffer whose content is a shared subsequence of this buffer's content.

Slice()

Creates a new char buffer whose content is a shared subsequence of this buffer's content.

[Android.Runtime.Register("slice", "()Ljava/nio/CharBuffer;", "GetSliceHandler")]
public abstract Java.Nio.CharBuffer? Slice ();
[<Android.Runtime.Register("slice", "()Ljava/nio/CharBuffer;", "GetSliceHandler")>]
override this.Slice : unit -> Java.Nio.CharBuffer

Returns

The new char buffer

Attributes

Remarks

Creates a new char buffer whose content is a shared subsequence of this buffer's content.

The content of the new buffer will start at this buffer's current position. 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 position will be zero, its capacity and its limit will be the number of chars remaining in this buffer, and its mark will be undefined. 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.

Java documentation for java.nio.CharBuffer.slice().

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

Slice(Int32, Int32)

Creates a new char buffer whose content is a shared subsequence of this buffer's content.

[Android.Runtime.Register("slice", "(II)Ljava/nio/CharBuffer;", "GetSlice_IIHandler", ApiSince=34)]
public virtual Java.Nio.CharBuffer? Slice (int index, int length);
[<Android.Runtime.Register("slice", "(II)Ljava/nio/CharBuffer;", "GetSlice_IIHandler", ApiSince=34)>]
override this.Slice : int * int -> Java.Nio.CharBuffer

Parameters

index
Int32

The position in this buffer at which the content of the new buffer will start; must be non-negative and no larger than #limit() limit()

length
Int32

The number of elements the new buffer will contain; must be non-negative and no larger than limit() - index

Returns

The new buffer

Attributes

Remarks

Creates a new char buffer whose content is a shared subsequence of this buffer's content.

The content of the new buffer will start at position index in this buffer, and will contain length elements. 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 position will be zero, its capacity and its limit will be length, its mark will be undefined, and its byte order will be

identical to that 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 13.

Java documentation for java.nio.CharBuffer.slice(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