MappedByteBuffer.Slice Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
| Name | Description |
|---|---|
| Slice() |
Creates a new byte buffer whose content is a shared subsequence of this buffer's content. |
| Slice(Int32, Int32) |
Creates a new byte buffer whose content is a shared subsequence of this buffer's content. |
Slice()
Creates a new byte buffer whose content is a shared subsequence of this buffer's content.
[Android.Runtime.Register("slice", "()Ljava/nio/ByteBuffer;", "GetSliceHandler", ApiSince=34)]
public override Java.Nio.ByteBuffer? Slice();
[<Android.Runtime.Register("slice", "()Ljava/nio/ByteBuffer;", "GetSliceHandler", ApiSince=34)>]
override this.Slice : unit -> Java.Nio.ByteBuffer
Returns
The new byte buffer
- Attributes
Remarks
Creates a new byte 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 bytes remaining in this buffer, its mark will be undefined, and its byte order will be BIG_ENDIAN. 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.
Reading bytes into physical memory by invoking load() on the returned buffer, or writing bytes to the storage device by invoking force() on the returned buffer, will only act on the sub-range of this buffer that the returned buffer represents, namely [position(),limit()).
Java documentation for java.nio.MappedByteBuffer.slice().
Java reference for java.nio.MappedByteBuffer.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 byte buffer whose content is a shared subsequence of this buffer's content.
[Android.Runtime.Register("slice", "(II)Ljava/nio/MappedByteBuffer;", "GetSlice_IIHandler", ApiSince=34)]
public virtual Java.Nio.MappedByteBuffer? Slice(int index, int length);
[<Android.Runtime.Register("slice", "(II)Ljava/nio/MappedByteBuffer;", "GetSlice_IIHandler", ApiSince=34)>]
override this.Slice : int * int -> Java.Nio.MappedByteBuffer
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()
- 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 byte 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 BIG_ENDIAN. 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.
Reading bytes into physical memory by invoking load() on the returned buffer, or writing bytes to the storage device by invoking force() on the returned buffer, will only act on the sub-range of this buffer that the returned buffer represents, namely [index,index+length), where index and length are assumed to satisfy the preconditions.
Java documentation for java.nio.MappedByteBuffer.slice(int, int).
Java reference for java.nio.MappedByteBuffer.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.