Package org.nustaq.offheap.bytez
Interface Bytez
- All Superinterfaces:
BasicBytez
,ByteSink
,ByteSource
- All Known Implementing Classes:
HeapBytez
,MallocBytez
,MemoryBytez
,MMFBytez
abstraction of byte arrays similar to ByteBuffer without the need to create temp objects in order to get long,int,.. views
additionally supports volatile read/write (for byte[] based backing buffers only !)
-
Method Summary
Modifier and TypeMethodDescriptionbyte[]
boolean
compareAndSwapInt
(long offset, int expect, int newVal) boolean
compareAndSwapLong
(long offset, long expect, long newVal) int
int
slice
(long off, int len) byte[]
toBytes
(long startIndex, int len) Methods inherited from interface org.nustaq.offheap.bytez.BasicBytez
copyTo, get, getArr, getBool, getBooleanArr, getChar, getCharArr, getDouble, getDoubleArr, getFloat, getFloatArr, getInt, getIntArr, getLong, getLongArr, getShort, getShortArr, length, newInstance, put, putBool, putChar, putDouble, putFloat, putInt, putLong, putShort, set, setBoolean, setChar, setDouble, setFloat, setInt, setLong, setShort
-
Method Details
-
slice
-
compareAndSwapInt
boolean compareAndSwapInt(long offset, int expect, int newVal) -
compareAndSwapLong
boolean compareAndSwapLong(long offset, long expect, long newVal) -
toBytes
byte[] toBytes(long startIndex, int len) -
asByteArray
byte[] asByteArray()- Returns:
- return the underlying byte array, not supported by MallocBytez !. Use getArr to extract data by copy instead.
-
getBAOffsetIndex
int getBAOffsetIndex()- Returns:
- the start index inside the byte array returned by asByteArray, not supported by MallocBytez
-
getBALength
int getBALength()- Returns:
- the length inside the byte array returned by asByteArray, not supported by MallocBytez
-