java.lang.Object
java.lang.Record
club.doki7.ffm.ptr.BytePtr
@ValueBasedCandidate
@UnsafeConstructor
public record BytePtr(@NotNull MemorySegment segment)
extends Record
implements IPointer, Iterable<Byte>
-
Constructor Summary
ConstructorsConstructorDescriptionBytePtr(@NotNull MemorySegment segment) Creates an instance of aBytePtrrecord class. -
Method Summary
Modifier and TypeMethodDescriptionstatic @NotNull BytePtrstatic @NotNull BytePtrstatic @NotNull BytePtrstatic @NotNull BytePtrallocate(@NotNull Arena arena, @NotNull ByteBuffer buffer) static @NotNull BytePtrallocate(@NotNull Arena arena, Collection<Byte> bytes) static @NotNull BytePtrallocateAligned(@NotNull Arena arena, long size, long alignment) static @NotNull BytePtrallocateString(@NotNull Arena arena, @NotNull String s) static @NotNull BytePtrstatic @Nullable BytePtrchecked(@NotNull MemorySegment segment) static @NotNull BytePtrchecked(@NotNull ByteBuffer buffer) final booleanIndicates whether some other object is "equal to" this one.static @NotNull BytePtrfinal inthashCode()Returns a hash code value for this object.iterator()@NotNull BytePtroffset(long offset) byteread()byteread(long index) @NotNull String@NotNull String@NotNull BytePtrreinterpret(long newSize) @NotNull MemorySegmentsegment()Returns the value of thesegmentrecord component.longsize()@NotNull BytePtrslice(long end) @NotNull BytePtrslice(long start, long end) final StringtoString()Returns a string representation of this record class.voidwrite(byte value) voidwrite(byte @NotNull [] bytes) voidwrite(long index, byte value) voidwriteString(@NotNull String s) voidwriteV(byte value0, byte @NotNull ... values) Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
Constructor Details
-
BytePtr
Creates an instance of aBytePtrrecord class.- Parameters:
segment- the value for thesegmentrecord component
-
-
Method Details
-
size
public long size() -
read
public byte read() -
write
public void write(byte value) -
read
public byte read(long index) -
write
public void write(long index, byte value) -
write
public void write(byte @NotNull [] bytes) -
writeV
public void writeV(byte value0, byte @NotNull ... values) -
writeString
-
readStringSafe
-
readString
-
reinterpret
-
offset
-
slice
-
slice
-
iterator
-
checked
-
checked
-
from
-
allocate
-
allocate
-
allocate
-
allocate
@NotNull public static @NotNull BytePtr allocate(@NotNull @NotNull Arena arena, Collection<Byte> bytes) -
allocateV
-
allocate
@NotNull public static @NotNull BytePtr allocate(@NotNull @NotNull Arena arena, @NotNull @NotNull ByteBuffer buffer) -
allocateAligned
-
allocateString
-
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
segment
Returns the value of thesegmentrecord component.
-