Class ByteBufferAccess

java.lang.Object
com.oracle.truffle.js.runtime.array.ByteBufferAccess

public abstract class ByteBufferAccess extends Object
  • Constructor Details

    • ByteBufferAccess

      public ByteBufferAccess()
  • Method Details

    • getInt8

      public final int getInt8(ByteBuffer buffer, int index)
    • getUint8

      public final int getUint8(ByteBuffer buffer, int index)
    • getInt16

      public abstract int getInt16(ByteBuffer buffer, int index)
    • getUint16

      public final int getUint16(ByteBuffer buffer, int index)
    • getInt32

      public abstract int getInt32(ByteBuffer buffer, int index)
    • getFloat16

      public final short getFloat16(ByteBuffer buffer, int index)
    • getFloat

      public abstract float getFloat(ByteBuffer buffer, int index)
    • getDouble

      public abstract double getDouble(ByteBuffer buffer, int index)
    • getInt64

      public abstract long getInt64(ByteBuffer buffer, int index)
    • putInt8

      public final void putInt8(ByteBuffer buffer, int index, int value)
    • putInt16

      public abstract void putInt16(ByteBuffer buffer, int index, int value)
    • putInt32

      public abstract void putInt32(ByteBuffer buffer, int index, int value)
    • putFloat16

      public final void putFloat16(ByteBuffer buffer, int index, short value)
    • putFloat

      public abstract void putFloat(ByteBuffer buffer, int index, float value)
    • putDouble

      public abstract void putDouble(ByteBuffer buffer, int index, double value)
    • putInt64

      public abstract void putInt64(ByteBuffer buffer, int index, long value)
    • compareExchangeInt32

      public abstract int compareExchangeInt32(ByteBuffer buffer, int index, int expectedValue, int newValue)
    • compareExchangeInt64

      public abstract long compareExchangeInt64(ByteBuffer buffer, int index, long expectedValue, long newValue)
    • compareExchangeInt8

      public int compareExchangeInt8(ByteBuffer buffer, int index, int expectedValue, int newValue)
      Emulate 8-bit CAS using 32-bit CAS. Cannot be used if the buffer length is not a multiple of 4 and too short for the 32-bit access to be fully in bounds.
    • compareExchangeInt16

      public int compareExchangeInt16(ByteBuffer buffer, int index, int expectedValue, int newValue)
      Emulate 16-bit CAS using 32-bit CAS. Cannot be used if the buffer length is not a multiple of 4 and too short for the 32-bit access to be fully in bounds, or if the index is odd.
    • littleEndian

      public static final ByteBufferAccess littleEndian()
    • bigEndian

      public static final ByteBufferAccess bigEndian()
    • nativeOrder

      public static final ByteBufferAccess nativeOrder()
    • forOrder

      public static final ByteBufferAccess forOrder(boolean littleEndian)