public final class MemorySlice extends Object implements Comparable<MemorySlice>
MemorySegment
.Constructor and Description |
---|
MemorySlice(MemorySegment segment,
int offset,
int length) |
Modifier and Type | Method and Description |
---|---|
int |
compareTo(MemorySlice other) |
byte[] |
copyBytes() |
boolean |
equals(Object o) |
byte[] |
getHeapMemory() |
int |
hashCode() |
int |
length() |
int |
offset() |
byte |
readByte(int position) |
int |
readInt(int position) |
long |
readLong(int position) |
MemorySegment |
segment() |
MemorySlice |
slice(int index,
int length) |
MemorySliceInput |
toInput() |
static MemorySlice |
wrap(byte[] bytes) |
static MemorySlice |
wrap(MemorySegment segment) |
public MemorySlice(MemorySegment segment, int offset, int length)
public MemorySegment segment()
public int offset()
public int length()
public MemorySlice slice(int index, int length)
public byte readByte(int position)
public int readInt(int position)
public long readLong(int position)
public byte[] getHeapMemory()
public byte[] copyBytes()
public MemorySliceInput toInput()
public static MemorySlice wrap(byte[] bytes)
public static MemorySlice wrap(MemorySegment segment)
public int compareTo(MemorySlice other)
compareTo
in interface Comparable<MemorySlice>
Copyright © 2023–2024 The Apache Software Foundation. All rights reserved.