Class MemoryBase

    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      protected MemoryBase()
      Protected parameterless constructor
        MemoryBase​(long pAddressInBytes, long pLengtInBytes)
      Constructs a MemoryBase given an address and length (absolute and all in bytes).
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      void copyFrom​(byte[] pFrom)
      Copies the content of a byte array to this memory object.
      void copyFrom​(byte[] pFrom, int pSrcOffset, long pDstOffset, int pLength)
      Copies the content of a byte array to this memory object.
      void copyFrom​(char[] pFrom)
      Copies the content of a char array to this memory object.
      void copyFrom​(char[] pFrom, int pSrcOffset, long pDstOffset, int pLength)
      Copies the content of a char array to this memory object.
      void copyFrom​(double[] pFrom)
      Copies the content of a double array to this memory object.
      void copyFrom​(double[] pFrom, int pSrcOffset, long pDstOffset, int pLength)
      Copies the content of a double array to this memory object.
      void copyFrom​(float[] pFrom)
      Copies the content of a float array to this memory object.
      void copyFrom​(float[] pFrom, int pSrcOffset, long pDstOffset, int pLength)
      Copies the content of a float array to this memory object.
      void copyFrom​(int[] pFrom)
      Copies the content of a int array to this memory object.
      void copyFrom​(int[] pFrom, int pSrcOffset, long pDstOffset, int pLength)
      Copies the content of a int array to this memory object.
      void copyFrom​(long[] pFrom)
      Copies the content of a long array to this memory object.
      void copyFrom​(long[] pFrom, int pSrcOffset, long pDstOffset, int pLength)
      Copies the content of a long array to this memory object.
      void copyFrom​(short[] pFrom)
      Copies the content of a short array to this memory object.
      void copyFrom​(short[] pFrom, int pSrcOffset, long pDstOffset, int pLength)
      Copies the content of a short array to this memory object.
      void copyFrom​(Buffer pBuffer)
      Copy from NIO buffer.
      void copyFrom​(ContiguousMemoryInterface pFrom)
      Copies an other memory object entirely into this one.
      void copyRangeTo​(long pSourceOffset, MemoryBase pTo, long pDestinationOffset, long pLengthToCopy)
      Copies range (offset_src,length) from this memory object to the range (offset_src,length) of a generic destination.
      void copyTo​(byte[] pTo)
      Copies the content of that memory object to a byte array.
      void copyTo​(byte[] pTo, long pSrcOffset, int pDstOffset, int pLength)
      Copies the content of that memory object to a byte array.
      void copyTo​(char[] pTo)
      Copies the content of that memory object to a char array.
      void copyTo​(char[] pTo, long pSrcOffset, int pDstOffset, int pLength)
      Copies the content of that memory object to a char array.
      void copyTo​(double[] pTo)
      Copies the content of that memory object to a double array.
      void copyTo​(double[] pTo, long pSrcOffset, int pDstOffset, int pLength)
      Copies the content of that memory object to a double array.
      void copyTo​(float[] pTo)
      Copies the content of that memory object to a float array.
      void copyTo​(float[] pTo, long pSrcOffset, int pDstOffset, int pLength)
      Copies the content of that memory object to a float array.
      void copyTo​(int[] pTo)
      Copies the content of that memory object to a int array.
      void copyTo​(int[] pTo, long pSrcOffset, int pDstOffset, int pLength)
      Copies the content of that memory object to a int array.
      void copyTo​(long[] pTo)
      Copies the content of that memory object to a long array.
      void copyTo​(long[] pTo, long pSrcOffset, int pDstOffset, int pLength)
      Copies the content of that memory object to a long array.
      void copyTo​(short[] pTo)
      Copies the content of that memory object to a short array.
      void copyTo​(short[] pTo, long pSrcOffset, int pDstOffset, int pLength)
      Copies the content of that memory object to a short array.
      void copyTo​(Buffer pBuffer)
      Copy to NIO buffer.
      void copyTo​(ContiguousMemoryInterface pTo)
      Copies this memory object entirely into an other.
      void free()
      Free this object, which means that the underlying ressources are released.
      long getAddress()
      Returns the memory's address.
      org.bridj.Pointer getBridJPointer​(Class pTargetClass)
      Returns a BridJ pointer for this memory.
      byte getByte​(long pOffset)
      Reads a value at a given offset.
      byte getByteAligned​(long pOffset)
      Reads a value at a given offset.
      ByteBuffer getByteBuffer()
      Returns NIO ByteBuffer
      char getChar​(long pOffset)
      Reads a value at a given offset.
      char getCharAligned​(long pOffset)
      Reads a value at a given offset.
      double getDouble​(long pOffset)
      Reads a value at a given offset.
      double getDoubleAligned​(long pOffset)
      Reads a value at a given offset.
      float getFloat​(long pOffset)
      Reads a value at a given offset.
      float getFloatAligned​(long pOffset)
      Reads a value at a given offset.
      int getInt​(long pOffset)
      Reads a value at a given offset.
      int getIntAligned​(long pOffset)
      Reads a value at a given offset.
      com.sun.jna.Pointer getJNAPointer()
      Rerturn a JNA pointer.
      long getLong​(long pOffset)
      Reads a value at a given offset.
      long getLongAligned​(long pOffset)
      Reads a value at a given offset.
      abstract MemoryType getMemoryType()
      Returns this memory object type.
      short getShort​(long pOffset)
      Reads a value at a given offset.
      short getShortAligned​(long pOffset)
      Reads a value at a given offset.
      long getSizeInBytes()
      Return this memory object's size in bytes.
      boolean isFree()
      Returns true if the object has been freed, which usually means that the underlying ressources are not longer available.
      long readBytesFromFileChannel​(long pPositionInBufferInBytes, FileChannel pFileChannel, long pFilePositionInBytes, long pLengthInBytes)  
      long readBytesFromFileChannel​(FileChannel pFileChannel, long pFilePositionInBytes, long pLengthInBytes)
      Reads data into this memory object for a certain position of a file channel.
      void setByte​(long pOffset, byte pValue)
      Writes a value at a given offset.
      void setByteAligned​(long pOffset, byte pValue)
      Writes a value at a given offset.
      void setChar​(long pOffset, char pValue)
      Writes a value at a given offset.
      void setCharAligned​(long pOffset, char pValue)
      Writes a value at a given offset.
      void setDouble​(long pOffset, double pValue)
      Writes a value at a given offset.
      void setDoubleAligned​(long pOffset, double pValue)
      Writes a value at a given offset.
      void setFloat​(long pOffset, float pValue)
      Writes a value at a given offset.
      void setFloatAligned​(long pOffset, float pValue)
      Writes a value at a given offset.
      void setInt​(long pOffset, int pValue)
      Writes a value at a given offset.
      void setIntAligned​(long pOffset, int pValue)
      Writes a value at a given offset.
      void setLong​(long pOffset, long pValue)
      Writes a value at a given offset.
      void setLongAligned​(long pOffset, long pValue)
      Writes a value at a given offset.
      void setShort​(long pOffset, short pValue)
      Writes a value at a given offset.
      void setShortAligned​(long pOffset, short pValue)
      Writes a value at a given offset.
      long writeBytesToFileChannel​(long pPositionInBufferInBytes, FileChannel pFileChannel, long pFilePositionInBytes, long pLengthInBytes)
      Writes data at a given range from this memory object at a given offset of a file channel.
      long writeBytesToFileChannel​(FileChannel pFileChannel, long pFilePositionInBytes)
      Writes the whole contents of this memory object at a given offset of a file channel.
    • Field Detail

      • mAddressInBytes

        protected long mAddressInBytes
      • mLengthInBytes

        protected long mLengthInBytes
      • mIsFree

        protected boolean mIsFree
    • Constructor Detail

      • MemoryBase

        protected MemoryBase()
        Protected parameterless constructor
      • MemoryBase

        public MemoryBase​(long pAddressInBytes,
                          long pLengtInBytes)
        Constructs a MemoryBase given an address and length (absolute and all in bytes).
        Parameters:
        pAddressInBytes - absolute address in bytes
        pLengtInBytes - length in bytes.
    • Method Detail

      • getSizeInBytes

        public long getSizeInBytes()
        Description copied from interface: SizedInBytes
        Return this memory object's size in bytes.
        Specified by:
        getSizeInBytes in interface SizedInBytes
        Returns:
        size in bytes.
      • copyRangeTo

        public void copyRangeTo​(long pSourceOffset,
                                MemoryBase pTo,
                                long pDestinationOffset,
                                long pLengthToCopy)
        Description copied from interface: RangeCopyable
        Copies range (offset_src,length) from this memory object to the range (offset_src,length) of a generic destination.
        Specified by:
        copyRangeTo in interface RangeCopyable<MemoryBase>
        Parameters:
        pSourceOffset - source offset
        pTo - destination
        pDestinationOffset - destination offset
        pLengthToCopy - length to copy in bytes.
      • free

        public void free()
        Description copied from interface: Freeable
        Free this object, which means that the underlying ressources are released.
        Specified by:
        free in interface Freeable
      • isFree

        public boolean isFree()
        Description copied from interface: Freeable
        Returns true if the object has been freed, which usually means that the underlying ressources are not longer available.
        Specified by:
        isFree in interface Freeable
        Returns:
        true if free
      • setByteAligned

        public void setByteAligned​(long pOffset,
                                   byte pValue)
        Description copied from interface: WriteAtAligned
        Writes a value at a given offset. The offset unit is 1 byte.
        Specified by:
        setByteAligned in interface WriteAtAligned
        Parameters:
        pOffset - offset
        pValue - value to set
      • setCharAligned

        public void setCharAligned​(long pOffset,
                                   char pValue)
        Description copied from interface: WriteAtAligned
        Writes a value at a given offset. The offset unit is 2 bytes (1 char).
        Specified by:
        setCharAligned in interface WriteAtAligned
        Parameters:
        pOffset - offset
        pValue - value to set
      • setShortAligned

        public void setShortAligned​(long pOffset,
                                    short pValue)
        Description copied from interface: WriteAtAligned
        Writes a value at a given offset. The offset unit is 2 bytes (1 short).
        Specified by:
        setShortAligned in interface WriteAtAligned
        Parameters:
        pOffset - offset
        pValue - value to set
      • setIntAligned

        public void setIntAligned​(long pOffset,
                                  int pValue)
        Description copied from interface: WriteAtAligned
        Writes a value at a given offset. The offset unit is 4 bytes (1 int).
        Specified by:
        setIntAligned in interface WriteAtAligned
        Parameters:
        pOffset - offset
        pValue - value to set
      • setLongAligned

        public void setLongAligned​(long pOffset,
                                   long pValue)
        Description copied from interface: WriteAtAligned
        Writes a value at a given offset. The offset unit is 8 bytes (1 long).
        Specified by:
        setLongAligned in interface WriteAtAligned
        Parameters:
        pOffset - offset
        pValue - value to set
      • setFloatAligned

        public void setFloatAligned​(long pOffset,
                                    float pValue)
        Description copied from interface: WriteAtAligned
        Writes a value at a given offset. The offset unit is 4 bytes (1 float).
        Specified by:
        setFloatAligned in interface WriteAtAligned
        Parameters:
        pOffset - offset
        pValue - value to set
      • setDoubleAligned

        public void setDoubleAligned​(long pOffset,
                                     double pValue)
        Description copied from interface: WriteAtAligned
        Writes a value at a given offset. The offset unit is 8 bytes (1 double).
        Specified by:
        setDoubleAligned in interface WriteAtAligned
        Parameters:
        pOffset - offset
        pValue - value to set
      • getByteAligned

        public byte getByteAligned​(long pOffset)
        Description copied from interface: ReadAtAligned
        Reads a value at a given offset. The offset unit is 1 byte.
        Specified by:
        getByteAligned in interface ReadAtAligned
        Parameters:
        pOffset - offset
        Returns:
        value
      • getCharAligned

        public char getCharAligned​(long pOffset)
        Description copied from interface: ReadAtAligned
        Reads a value at a given offset. The offset unit is 2 bytes (1 char).
        Specified by:
        getCharAligned in interface ReadAtAligned
        Parameters:
        pOffset - offset
        Returns:
        value
      • getShortAligned

        public short getShortAligned​(long pOffset)
        Description copied from interface: ReadAtAligned
        Reads a value at a given offset. The offset unit is 2 bytes (1 short).
        Specified by:
        getShortAligned in interface ReadAtAligned
        Parameters:
        pOffset - offset
        Returns:
        value
      • getIntAligned

        public int getIntAligned​(long pOffset)
        Description copied from interface: ReadAtAligned
        Reads a value at a given offset. The offset unit is 4 bytes (1 int).
        Specified by:
        getIntAligned in interface ReadAtAligned
        Parameters:
        pOffset - offset
        Returns:
        value
      • getLongAligned

        public long getLongAligned​(long pOffset)
        Description copied from interface: ReadAtAligned
        Reads a value at a given offset. The offset unit is 8 bytes (1 long).
        Specified by:
        getLongAligned in interface ReadAtAligned
        Parameters:
        pOffset - offset
        Returns:
        value
      • getFloatAligned

        public float getFloatAligned​(long pOffset)
        Description copied from interface: ReadAtAligned
        Reads a value at a given offset. The offset unit is 4 bytes (1 float).
        Specified by:
        getFloatAligned in interface ReadAtAligned
        Parameters:
        pOffset - offset
        Returns:
        value
      • getDoubleAligned

        public double getDoubleAligned​(long pOffset)
        Description copied from interface: ReadAtAligned
        Reads a value at a given offset. The offset unit is 8 bytes (1 double).
        Specified by:
        getDoubleAligned in interface ReadAtAligned
        Parameters:
        pOffset - offset
        Returns:
        value
      • setByte

        public void setByte​(long pOffset,
                            byte pValue)
        Description copied from interface: WriteAt
        Writes a value at a given offset.
        Specified by:
        setByte in interface WriteAt
        Parameters:
        pOffset - offset
        pValue - value to set
      • setChar

        public void setChar​(long pOffset,
                            char pValue)
        Description copied from interface: WriteAt
        Writes a value at a given offset.
        Specified by:
        setChar in interface WriteAt
        Parameters:
        pOffset - offset
        pValue - value to set
      • setShort

        public void setShort​(long pOffset,
                             short pValue)
        Description copied from interface: WriteAt
        Writes a value at a given offset.
        Specified by:
        setShort in interface WriteAt
        Parameters:
        pOffset - offset
        pValue - value to set
      • setInt

        public void setInt​(long pOffset,
                           int pValue)
        Description copied from interface: WriteAt
        Writes a value at a given offset.
        Specified by:
        setInt in interface WriteAt
        Parameters:
        pOffset - offset
        pValue - value to set
      • setLong

        public void setLong​(long pOffset,
                            long pValue)
        Description copied from interface: WriteAt
        Writes a value at a given offset.
        Specified by:
        setLong in interface WriteAt
        Parameters:
        pOffset - offset
        pValue - value to set
      • setFloat

        public void setFloat​(long pOffset,
                             float pValue)
        Description copied from interface: WriteAt
        Writes a value at a given offset.
        Specified by:
        setFloat in interface WriteAt
        Parameters:
        pOffset - offset
        pValue - value to set
      • setDouble

        public void setDouble​(long pOffset,
                              double pValue)
        Description copied from interface: WriteAt
        Writes a value at a given offset.
        Specified by:
        setDouble in interface WriteAt
        Parameters:
        pOffset - offset
        pValue - value to set
      • getByte

        public byte getByte​(long pOffset)
        Description copied from interface: ReadAt
        Reads a value at a given offset.
        Specified by:
        getByte in interface ReadAt
        Parameters:
        pOffset - offset
        Returns:
        value
      • getChar

        public char getChar​(long pOffset)
        Description copied from interface: ReadAt
        Reads a value at a given offset.
        Specified by:
        getChar in interface ReadAt
        Parameters:
        pOffset - offset
        Returns:
        value
      • getShort

        public short getShort​(long pOffset)
        Description copied from interface: ReadAt
        Reads a value at a given offset.
        Specified by:
        getShort in interface ReadAt
        Parameters:
        pOffset - offset
        Returns:
        value
      • getInt

        public int getInt​(long pOffset)
        Description copied from interface: ReadAt
        Reads a value at a given offset.
        Specified by:
        getInt in interface ReadAt
        Parameters:
        pOffset - offset
        Returns:
        value
      • getLong

        public long getLong​(long pOffset)
        Description copied from interface: ReadAt
        Reads a value at a given offset.
        Specified by:
        getLong in interface ReadAt
        Parameters:
        pOffset - offset
        Returns:
        value
      • getFloat

        public float getFloat​(long pOffset)
        Description copied from interface: ReadAt
        Reads a value at a given offset.
        Specified by:
        getFloat in interface ReadAt
        Parameters:
        pOffset - offset
        Returns:
        value
      • getDouble

        public double getDouble​(long pOffset)
        Description copied from interface: ReadAt
        Reads a value at a given offset.
        Specified by:
        getDouble in interface ReadAt
        Parameters:
        pOffset - offset
        Returns:
        value
      • writeBytesToFileChannel

        public long writeBytesToFileChannel​(FileChannel pFileChannel,
                                            long pFilePositionInBytes)
                                     throws IOException
        Description copied from interface: ReadWriteBytesFileChannel
        Writes the whole contents of this memory object at a given offset of a file channel.
        Specified by:
        writeBytesToFileChannel in interface ReadWriteBytesFileChannel
        Parameters:
        pFileChannel - file channel
        pFilePositionInBytes - file position
        Returns:
        file position past the last written byte.
        Throws:
        IOException - Thrown in case of IO problem.
      • copyTo

        public void copyTo​(byte[] pTo)
        Description copied from interface: CopyFromToJavaArray
        Copies the content of that memory object to a byte array.
        Specified by:
        copyTo in interface CopyFromToJavaArray
        Parameters:
        pTo - preallocated byte array.
      • copyTo

        public void copyTo​(short[] pTo)
        Description copied from interface: CopyFromToJavaArray
        Copies the content of that memory object to a short array.
        Specified by:
        copyTo in interface CopyFromToJavaArray
        Parameters:
        pTo - preallocated short array.
      • copyTo

        public void copyTo​(char[] pTo)
        Description copied from interface: CopyFromToJavaArray
        Copies the content of that memory object to a char array.
        Specified by:
        copyTo in interface CopyFromToJavaArray
        Parameters:
        pTo - preallocated char array.
      • copyTo

        public void copyTo​(int[] pTo)
        Description copied from interface: CopyFromToJavaArray
        Copies the content of that memory object to a int array.
        Specified by:
        copyTo in interface CopyFromToJavaArray
        Parameters:
        pTo - preallocated int array.
      • copyTo

        public void copyTo​(long[] pTo)
        Description copied from interface: CopyFromToJavaArray
        Copies the content of that memory object to a long array.
        Specified by:
        copyTo in interface CopyFromToJavaArray
        Parameters:
        pTo - preallocated long array.
      • copyTo

        public void copyTo​(float[] pTo)
        Description copied from interface: CopyFromToJavaArray
        Copies the content of that memory object to a float array.
        Specified by:
        copyTo in interface CopyFromToJavaArray
        Parameters:
        pTo - preallocated float array.
      • copyTo

        public void copyTo​(double[] pTo)
        Description copied from interface: CopyFromToJavaArray
        Copies the content of that memory object to a double array.
        Specified by:
        copyTo in interface CopyFromToJavaArray
        Parameters:
        pTo - preallocated double array.
      • copyFrom

        public void copyFrom​(byte[] pFrom)
        Description copied from interface: CopyFromToJavaArray
        Copies the content of a byte array to this memory object.
        Specified by:
        copyFrom in interface CopyFromToJavaArray
        Parameters:
        pFrom - preallocated byte array.
      • copyFrom

        public void copyFrom​(short[] pFrom)
        Description copied from interface: CopyFromToJavaArray
        Copies the content of a short array to this memory object.
        Specified by:
        copyFrom in interface CopyFromToJavaArray
        Parameters:
        pFrom - preallocated short array.
      • copyFrom

        public void copyFrom​(char[] pFrom)
        Description copied from interface: CopyFromToJavaArray
        Copies the content of a char array to this memory object.
        Specified by:
        copyFrom in interface CopyFromToJavaArray
        Parameters:
        pFrom - preallocated char array.
      • copyFrom

        public void copyFrom​(int[] pFrom)
        Description copied from interface: CopyFromToJavaArray
        Copies the content of a int array to this memory object.
        Specified by:
        copyFrom in interface CopyFromToJavaArray
        Parameters:
        pFrom - preallocated int array.
      • copyFrom

        public void copyFrom​(long[] pFrom)
        Description copied from interface: CopyFromToJavaArray
        Copies the content of a long array to this memory object.
        Specified by:
        copyFrom in interface CopyFromToJavaArray
        Parameters:
        pFrom - preallocated long array.
      • copyFrom

        public void copyFrom​(float[] pFrom)
        Description copied from interface: CopyFromToJavaArray
        Copies the content of a float array to this memory object.
        Specified by:
        copyFrom in interface CopyFromToJavaArray
        Parameters:
        pFrom - preallocated float array.
      • copyFrom

        public void copyFrom​(double[] pFrom)
        Description copied from interface: CopyFromToJavaArray
        Copies the content of a double array to this memory object.
        Specified by:
        copyFrom in interface CopyFromToJavaArray
        Parameters:
        pFrom - preallocated double array.
      • copyTo

        public void copyTo​(byte[] pTo,
                           long pSrcOffset,
                           int pDstOffset,
                           int pLength)
        Description copied from interface: CopyRangeFromToJavaArray
        Copies the content of that memory object to a byte array.
        Specified by:
        copyTo in interface CopyRangeFromToJavaArray
        Parameters:
        pTo - preallocated byte array.
        pSrcOffset - source offset (array elements)
        pDstOffset - destination offset (array elements)
        pLength - length in array elements
      • copyTo

        public void copyTo​(short[] pTo,
                           long pSrcOffset,
                           int pDstOffset,
                           int pLength)
        Description copied from interface: CopyRangeFromToJavaArray
        Copies the content of that memory object to a short array.
        Specified by:
        copyTo in interface CopyRangeFromToJavaArray
        Parameters:
        pTo - preallocated short array.
        pSrcOffset - source offset (array elements)
        pDstOffset - destination offset (array elements)
        pLength - length in array elements
      • copyTo

        public void copyTo​(char[] pTo,
                           long pSrcOffset,
                           int pDstOffset,
                           int pLength)
        Description copied from interface: CopyRangeFromToJavaArray
        Copies the content of that memory object to a char array.
        Specified by:
        copyTo in interface CopyRangeFromToJavaArray
        Parameters:
        pTo - preallocated char array.
        pSrcOffset - source offset (array elements)
        pDstOffset - destination offset (array elements)
        pLength - length in array elements
      • copyTo

        public void copyTo​(int[] pTo,
                           long pSrcOffset,
                           int pDstOffset,
                           int pLength)
        Description copied from interface: CopyRangeFromToJavaArray
        Copies the content of that memory object to a int array.
        Specified by:
        copyTo in interface CopyRangeFromToJavaArray
        Parameters:
        pTo - preallocated int array.
        pSrcOffset - source offset (array elements)
        pDstOffset - destination offset (array elements)
        pLength - length in array elements
      • copyTo

        public void copyTo​(long[] pTo,
                           long pSrcOffset,
                           int pDstOffset,
                           int pLength)
        Description copied from interface: CopyRangeFromToJavaArray
        Copies the content of that memory object to a long array.
        Specified by:
        copyTo in interface CopyRangeFromToJavaArray
        Parameters:
        pTo - preallocated long array.
        pSrcOffset - source offset (array elements)
        pDstOffset - destination offset (array elements)
        pLength - length in array elements
      • copyTo

        public void copyTo​(float[] pTo,
                           long pSrcOffset,
                           int pDstOffset,
                           int pLength)
        Description copied from interface: CopyRangeFromToJavaArray
        Copies the content of that memory object to a float array.
        Specified by:
        copyTo in interface CopyRangeFromToJavaArray
        Parameters:
        pTo - preallocated float array.
        pSrcOffset - source offset (array elements)
        pDstOffset - destination offset (array elements)
        pLength - length in array elements
      • copyTo

        public void copyTo​(double[] pTo,
                           long pSrcOffset,
                           int pDstOffset,
                           int pLength)
        Description copied from interface: CopyRangeFromToJavaArray
        Copies the content of that memory object to a double array.
        Specified by:
        copyTo in interface CopyRangeFromToJavaArray
        Parameters:
        pTo - preallocated double array.
        pSrcOffset - source offset (array elements)
        pDstOffset - destination offset (array elements)
        pLength - length in array elements
      • copyFrom

        public void copyFrom​(byte[] pFrom,
                             int pSrcOffset,
                             long pDstOffset,
                             int pLength)
        Description copied from interface: CopyRangeFromToJavaArray
        Copies the content of a byte array to this memory object.
        Specified by:
        copyFrom in interface CopyRangeFromToJavaArray
        Parameters:
        pFrom - preallocated byte array.
        pSrcOffset - source offset (array elements)
        pDstOffset - destination offset (array elements)
        pLength - length in array elements
      • copyFrom

        public void copyFrom​(short[] pFrom,
                             int pSrcOffset,
                             long pDstOffset,
                             int pLength)
        Description copied from interface: CopyRangeFromToJavaArray
        Copies the content of a short array to this memory object.
        Specified by:
        copyFrom in interface CopyRangeFromToJavaArray
        Parameters:
        pFrom - preallocated short array.
        pSrcOffset - source offset (array elements)
        pDstOffset - destination offset (array elements)
        pLength - length in array elements
      • copyFrom

        public void copyFrom​(char[] pFrom,
                             int pSrcOffset,
                             long pDstOffset,
                             int pLength)
        Description copied from interface: CopyRangeFromToJavaArray
        Copies the content of a char array to this memory object.
        Specified by:
        copyFrom in interface CopyRangeFromToJavaArray
        Parameters:
        pFrom - preallocated char array.
        pSrcOffset - source offset (array elements)
        pDstOffset - destination offset (array elements)
        pLength - length in array elements
      • copyFrom

        public void copyFrom​(int[] pFrom,
                             int pSrcOffset,
                             long pDstOffset,
                             int pLength)
        Description copied from interface: CopyRangeFromToJavaArray
        Copies the content of a int array to this memory object.
        Specified by:
        copyFrom in interface CopyRangeFromToJavaArray
        Parameters:
        pFrom - preallocated int array.
        pSrcOffset - source offset (array elements)
        pDstOffset - destination offset (array elements)
        pLength - length in array elements
      • copyFrom

        public void copyFrom​(long[] pFrom,
                             int pSrcOffset,
                             long pDstOffset,
                             int pLength)
        Description copied from interface: CopyRangeFromToJavaArray
        Copies the content of a long array to this memory object.
        Specified by:
        copyFrom in interface CopyRangeFromToJavaArray
        Parameters:
        pFrom - preallocated long array.
        pSrcOffset - source offset (array elements)
        pDstOffset - destination offset (array elements)
        pLength - length in array elements
      • copyFrom

        public void copyFrom​(float[] pFrom,
                             int pSrcOffset,
                             long pDstOffset,
                             int pLength)
        Description copied from interface: CopyRangeFromToJavaArray
        Copies the content of a float array to this memory object.
        Specified by:
        copyFrom in interface CopyRangeFromToJavaArray
        Parameters:
        pFrom - preallocated float array.
        pSrcOffset - source offset (array elements)
        pDstOffset - destination offset (array elements)
        pLength - length in array elements
      • copyFrom

        public void copyFrom​(double[] pFrom,
                             int pSrcOffset,
                             long pDstOffset,
                             int pLength)
        Description copied from interface: CopyRangeFromToJavaArray
        Copies the content of a double array to this memory object.
        Specified by:
        copyFrom in interface CopyRangeFromToJavaArray
        Parameters:
        pFrom - preallocated double array.
        pSrcOffset - source offset (array elements)
        pDstOffset - destination offset (array elements)
        pLength - length in array elements
      • writeBytesToFileChannel

        public long writeBytesToFileChannel​(long pPositionInBufferInBytes,
                                            FileChannel pFileChannel,
                                            long pFilePositionInBytes,
                                            long pLengthInBytes)
                                     throws IOException
        Description copied from interface: ReadWriteBytesFileChannel
        Writes data at a given range from this memory object at a given offset of a file channel.
        Specified by:
        writeBytesToFileChannel in interface ReadWriteBytesFileChannel
        Parameters:
        pPositionInBufferInBytes - offset in memory object
        pFileChannel - file channel
        pFilePositionInBytes - file channel offset
        pLengthInBytes - length in bytes
        Returns:
        file position past the last written byte.
        Throws:
        IOException - Thrown in case of IO problem.
      • readBytesFromFileChannel

        public long readBytesFromFileChannel​(FileChannel pFileChannel,
                                             long pFilePositionInBytes,
                                             long pLengthInBytes)
                                      throws IOException
        Description copied from interface: ReadWriteBytesFileChannel
        Reads data into this memory object for a certain position of a file channel.
        Specified by:
        readBytesFromFileChannel in interface ReadWriteBytesFileChannel
        Parameters:
        pFileChannel - file channel
        pFilePositionInBytes - offset in file channel
        pLengthInBytes - length in bytes
        Returns:
        File position past the last byte read.
        Throws:
        IOException - Thrown in case of IO problem.
      • readBytesFromFileChannel

        public long readBytesFromFileChannel​(long pPositionInBufferInBytes,
                                             FileChannel pFileChannel,
                                             long pFilePositionInBytes,
                                             long pLengthInBytes)
                                      throws IOException
        Specified by:
        readBytesFromFileChannel in interface ReadWriteBytesFileChannel
        Parameters:
        pPositionInBufferInBytes - offset in memory object
        pFileChannel - file channel
        pFilePositionInBytes - offset in file channel
        pLengthInBytes - length in bytes
        Returns:
        File position past the last byte read.
        Throws:
        IOException - Thrown in case of IO problem.
      • getJNAPointer

        public com.sun.jna.Pointer getJNAPointer()
        Rerturn a JNA pointer. Usefull when interacting with JNA based bindings.
        Specified by:
        getJNAPointer in interface JNAPointerWrappable
        Returns:
        off-heap memory object