public final class UnsafeUtil extends Object
| Modifier and Type | Method and Description |
|---|---|
static void |
assertBounds(long reqOff,
long reqLen,
long allocSize)
Assert the requested offset and length against the allocated size.
|
static void |
checkBounds(long reqOff,
long reqLen,
long allocSize)
Check the requested offset and length against the allocated size.
|
public static final sun.misc.Unsafe unsafe
public static final String JDK
public static final int JDK_MAJOR
public static final int ADDRESS_SIZE
public static final long ARRAY_BOOLEAN_BASE_OFFSET
public static final long ARRAY_BYTE_BASE_OFFSET
public static final long ARRAY_SHORT_BASE_OFFSET
public static final long ARRAY_CHAR_BASE_OFFSET
public static final long ARRAY_INT_BASE_OFFSET
public static final long ARRAY_LONG_BASE_OFFSET
public static final long ARRAY_FLOAT_BASE_OFFSET
public static final long ARRAY_DOUBLE_BASE_OFFSET
public static final long ARRAY_OBJECT_BASE_OFFSET
public static final int ARRAY_BOOLEAN_INDEX_SCALE
public static final int ARRAY_BYTE_INDEX_SCALE
public static final long ARRAY_SHORT_INDEX_SCALE
public static final long ARRAY_CHAR_INDEX_SCALE
public static final long ARRAY_INT_INDEX_SCALE
public static final long ARRAY_LONG_INDEX_SCALE
public static final long ARRAY_FLOAT_INDEX_SCALE
public static final long ARRAY_DOUBLE_INDEX_SCALE
public static final long ARRAY_OBJECT_INDEX_SCALE
public static final int BOOLEAN_SHIFT
public static final int BYTE_SHIFT
public static final long SHORT_SHIFT
public static final long CHAR_SHIFT
public static final long INT_SHIFT
public static final long LONG_SHIFT
public static final long FLOAT_SHIFT
public static final long DOUBLE_SHIFT
public static final long OBJECT_SHIFT
public static final String LS
public static void assertBounds(long reqOff,
long reqLen,
long allocSize)
0 <= reqOff <= reqLen <= reqOff + reqLen <= allocSize.
If this equation is violated and assertions are enabled, an AssertionError will
be thrown.reqOff - the requested offsetreqLen - the requested lengthallocSize - the allocated size.public static void checkBounds(long reqOff,
long reqLen,
long allocSize)
0 <= reqOff <= reqLen <= reqOff + reqLen <= allocSize.
If this equation is violated an IllegalArgumentException will be thrown.reqOff - the requested offsetreqLen - the requested lengthallocSize - the allocated size.Copyright © 2015–2021 The Apache Software Foundation. All rights reserved.