Class UnsafeMemory

  • All Implemented Interfaces:
    Memory

    class UnsafeMemory
    extends java.lang.Object
    implements Memory
    • Constructor Summary

      Constructors 
      Constructor Description
      UnsafeMemory()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void copyLong​(byte[] src, int srcIndex, byte[] dest, int destIndex)  
      void copyMemory​(byte[] input, int inputIndex, byte[] output, int outputIndex, int length)  
      boolean fastAccessSupported()  
      int loadByte​(byte[] data, int index)  
      int loadInt​(byte[] data, int index)  
      long loadLong​(byte[] data, int index)  
      int lookupShort​(short[] data, int index)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • unsafe

        private static final sun.misc.Unsafe unsafe
      • BYTE_ARRAY_OFFSET

        private static final long BYTE_ARRAY_OFFSET
      • SHORT_ARRAY_OFFSET

        private static final long SHORT_ARRAY_OFFSET
      • SHORT_ARRAY_STRIDE

        private static final long SHORT_ARRAY_STRIDE
    • Constructor Detail

      • UnsafeMemory

        UnsafeMemory()
    • Method Detail

      • lookupShort

        public int lookupShort​(short[] data,
                               int index)
        Specified by:
        lookupShort in interface Memory
      • loadByte

        public int loadByte​(byte[] data,
                            int index)
        Specified by:
        loadByte in interface Memory
      • loadInt

        public int loadInt​(byte[] data,
                           int index)
        Specified by:
        loadInt in interface Memory
      • copyLong

        public void copyLong​(byte[] src,
                             int srcIndex,
                             byte[] dest,
                             int destIndex)
        Specified by:
        copyLong in interface Memory
      • loadLong

        public long loadLong​(byte[] data,
                             int index)
        Specified by:
        loadLong in interface Memory
      • copyMemory

        public void copyMemory​(byte[] input,
                               int inputIndex,
                               byte[] output,
                               int outputIndex,
                               int length)
        Specified by:
        copyMemory in interface Memory