Package io.airlift.slice
Class UnsafeSliceFactory
java.lang.Object
io.airlift.slice.UnsafeSliceFactory
A slice factory for creating unsafe slices
-
Method Summary
Modifier and TypeMethodDescriptionstatic UnsafeSliceFactoryGet a factory for creating "unsafe" slices that can reference arbitrary memory addresses.newSlice(long address, int size) Creates a slice for directly a raw memory address.Creates a slice for directly a raw memory address.
-
Method Details
-
getInstance
Get a factory for creating "unsafe" slices that can reference arbitrary memory addresses. If there is a security manager, itscheckPermissionmethod is called with aReflectPermission("suppressAccessChecks")permission.- Returns:
- an unsafe slice factory
-
newSlice
Creates a slice for directly a raw memory address. This is inherently unsafe as it may be used to access arbitrary memory.- Parameters:
address- the raw memory address basesize- the size of the slice- Returns:
- the unsafe slice
-
newSlice
Creates a slice for directly a raw memory address. This is inherently unsafe as it may be used to access arbitrary memory. The slice will hold the specified object reference to prevent the garbage collector from freeing it while it is in use by the slice.- Parameters:
address- the raw memory address basesize- the size of the slicereference- the object reference- Returns:
- the unsafe slice
-
newSlice
-