This class may be removed in the future. Consider the replacements in JEP 193 'Variable Handles': http://openjdk.java.net/jeps/193
static void putByte(byte[] data, int index, byte value) { UNSAFE.putByte(data, BYTE_ARRAY_BASE_OFFSET + index, value); }
static void putByte(long address, byte value) { UNSAFE.putByte(address, value); }
void setByteUnchecked(int index, int value) { unsafe.putByte(base, address + index, (byte) (value & 0xFF)); }
@Override public void put(long byteIndex, byte value) { unsafe.putByte(baseAdress + byteIndex, value); }
public static void putByte( Object obj, long offset, byte value ) { unsafe.putByte( obj, offset, value ); }
static void putByte(long address, byte value) { UNSAFE.putByte(address, value); }
static void putByte(byte[] data, int index, byte value) { UNSAFE.putByte(data, BYTE_ARRAY_BASE_OFFSET + index, value); }
/** * Stores byte value into object field. * * @param obj Object. * @param fieldOff Field offset. * @param val Value. */ public static void putByteField(Object obj, long fieldOff, byte val) { UNSAFE.putByte(obj, fieldOff, val); }
/** * Stores byte value into byte array. * * @param arr Byte array. * @param off Offset. * @param val Value. */ public static void putByte(byte[] arr, long off, byte val) { UNSAFE.putByte(arr, off, val); }
/** * Stores given byte value. * * @param addr Address. * @param val Value. */ public static void putByte(long addr, byte val) { UNSAFE.putByte(addr, val); }
@Override public final void setBytes(long bytePos, byte[] values, int length) { for (int offset = 0; offset < length; offset++) { UNSAFE.putByte(address + bytePos + offset, values[offset]); } }
static void putByte(long address, byte value) { UNSAFE.putByte(address, value); }
public void clear(int offset, int length) { while (length >= SIZE_OF_LONG) { unsafe.putLong(base, address + offset, 0); offset += SIZE_OF_LONG; length -= SIZE_OF_LONG; } while (length > 0) { unsafe.putByte(base, address + offset, (byte) 0); offset++; length--; } }
@Override void putByte(byte[] array, long offset, byte b) { UNSAFE.putByte(array, arrayOffset + offset, b); } @Override short getShort(byte[] array, long offset) { return UNSAFE.getShort(array, arrayOffset + offset); }
@Override public final void put(int index, byte b) { final long pos = address + index; if (index >= 0 && pos < addressLimit) { UNSAFE.putByte(heapMemory, pos, b); } else if (address > addressLimit) { throw new IllegalStateException("segment has been freed"); } else { // index is in fact invalid throw new IndexOutOfBoundsException(); } }
@Override public void put(long byteIndex, byte value) { checkIndex(byteIndex,1); unsafe.putByte(base,off+byteIndex,value); }
public final void setByteValue(Object newObj, byte b) throws IllegalAccessException { if (!isAndroid && memOffset >= 0) { FSTUtil.unFlaggedUnsafe.putByte(newObj, memOffset, b); return; } field.setByte(newObj, b); }
public static void putByte( long address, byte value ) { checkAccess( address, Byte.BYTES ); unsafe.putByte( address, value ); }
/** * Fill the slice with the specified value; */ public void fill(byte value) { int offset = 0; int length = size; long longValue = fillLong(value); while (length >= SIZE_OF_LONG) { unsafe.putLong(base, address + offset, longValue); offset += SIZE_OF_LONG; length -= SIZE_OF_LONG; } while (length > 0) { unsafe.putByte(base, address + offset, value); offset++; length--; } }
/** * Set the given number of bytes to the given value, starting from the given address. */ public static void setMemory( long address, long bytes, byte value ) { if ( 0 == (address & 1) && bytes > 64 ) { unsafe.putByte( address, value ); unsafe.setMemory( address + 1, bytes - 1, value ); } else { unsafe.setMemory( address, bytes, value ); } }