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); } }