public final class UnsafeUtils extends Object
sun.misc.Unsafe
to access some internal details to get
better performance.
This class is an internal implementation detail only intended for use within spectator. It is subject to change without notice.
Modifier and Type | Method and Description |
---|---|
static long |
getLong(byte[] bytes,
int offset)
Treat a seq of 8 bytes at the given offset as a long value.
|
static byte[] |
getStringValueBytes(String str)
Get the value array for a String as an array of bytes.
|
static char[] |
getStringValueChars(String str)
Get the value array for a String as an array of characters.
|
static boolean |
stringValueBytes()
Returns true if it is a newer JDK that uses a byte array for the characters.
|
static boolean |
stringValueSupported()
Returns true if extracting the underlying value array for a String is supported.
|
static boolean |
supported()
Returns true if unsafe operations are supported.
|
public static boolean supported()
public static boolean stringValueSupported()
public static boolean stringValueBytes()
public static byte[] getStringValueBytes(String str)
public static char[] getStringValueChars(String str)
public static long getLong(byte[] bytes, int offset)