@Override default int readVolatileInt(S handle, long offset) { return handle.readVolatileInt(offset); }
@Override default int readVolatileInt(S handle, long offset) { return handle.readVolatileInt(offset); }
/** * Read a float from memory with a load barrier. * * @param offset to read * @return the float value * @throws BufferUnderflowException if the offset is outside the limits of the Bytes */ default float readVolatileFloat(long offset) throws BufferUnderflowException { return Float.intBitsToFloat(readVolatileInt(offset)); }
default int peekVolatileInt() throws BufferUnderflowException { return readVolatileInt(readPosition()); }
public static float addAndGetFloat(@org.jetbrains.annotations.NotNull @NotNull RandomDataInput in, long offset, float adding) throws BufferUnderflowException { try { for (; ; ) { int value = in.readVolatileInt(offset); float value1 = Float.intBitsToFloat(value) + adding; int value2 = Float.floatToRawIntBits(value1); if (in.compareAndSwapInt(offset, value, value2)) return value1; } } catch (BufferOverflowException e) { throw new AssertionError(e); } }
public static int addAndGetInt(@org.jetbrains.annotations.NotNull @NotNull RandomDataInput in, long offset, int adding) throws BufferUnderflowException { try { for (; ; ) { int value = in.readVolatileInt(offset); int value2 = value + adding; if (in.compareAndSwapInt(offset, value, value2)) return value2; } } catch (BufferOverflowException e) { throw new AssertionError(e); } }