Class PrimitiveArrayUtils.UnsafeImpl

java.lang.Object
org.greenrobot.essentials.PrimitiveArrayUtils
org.greenrobot.essentials.PrimitiveArrayUtils.UnsafeImpl
Enclosing class:
PrimitiveArrayUtils

private static class PrimitiveArrayUtils.UnsafeImpl extends PrimitiveArrayUtils
  • Field Details

    • BIG_ENDIAN

      private static final boolean BIG_ENDIAN
    • UNALIGNED

      private static final boolean UNALIGNED
    • UNSAFE

      private static final sun.misc.Unsafe UNSAFE
      Set only if UNALIGNED == true.
    • BYTE_ARRAY_OFFSET

      private static final long BYTE_ARRAY_OFFSET
      Set only if UNALIGNED == true.
    • CHAR_ARRAY_OFFSET

      private static final long CHAR_ARRAY_OFFSET
      Set only if UNALIGNED == true.
  • Constructor Details

    • UnsafeImpl

      private UnsafeImpl()
  • Method Details

    • initUnaligned

      private static boolean initUnaligned()
    • guessUnalignedFromOsArch

      private static boolean guessUnalignedFromOsArch()
    • initUnsafe

      private static sun.misc.Unsafe initUnsafe()
    • getIntLE

      public int getIntLE(byte[] bytes, int index)
      Little endian.
      Specified by:
      getIntLE in class PrimitiveArrayUtils
    • getIntLE

      public int getIntLE(char[] chars, int index)
      Little endian.
      Specified by:
      getIntLE in class PrimitiveArrayUtils
    • getIntBE

      public int getIntBE(byte[] bytes, int index)
      Big endian.
      Specified by:
      getIntBE in class PrimitiveArrayUtils
    • getLongLE

      public long getLongLE(byte[] bytes, int index)
      Little endian.
      Specified by:
      getLongLE in class PrimitiveArrayUtils
    • getLongBE

      public long getLongBE(byte[] bytes, int index)
      Big endian.
      Specified by:
      getLongBE in class PrimitiveArrayUtils