public final class InternalByteArray extends Object
TruffleString
's internal byte array, along with a byte offset
and length defining the region in use.Modifier and Type | Method and Description |
---|---|
byte |
get(int index)
Read the byte at
getArray()[getOffset() + index] and return it as a byte, similar to
TruffleString.ReadByteNode . |
byte[] |
getArray()
Get the internal byte array.
|
int |
getEnd()
Get the string region's end (
offset + length ). |
int |
getLength()
Get the string region's length.
|
int |
getOffset()
Get the string region's starting index.
|
public byte[] getArray()
public int getOffset()
public int getLength()
public int getEnd()
offset + length
).public byte get(int index)
getArray()[getOffset() + index]
and return it as a byte, similar to
TruffleString.ReadByteNode
. Consider using TruffleString.ReadByteNode
(and
TruffleString.MaterializeNode
before) instead if not needing the byte[] for other
purposes, as that will avoid extra copying if the string is
stored in native memory
.