Package net.haesleinhuepf.clij.coremem
Class SafeContiguousMemory
- java.lang.Object
-
- net.haesleinhuepf.clij.coremem.SafeContiguousMemory
-
- All Implemented Interfaces:
ContiguousMemoryInterface,BridJPointerWrappable,ByteBufferWrappable,Copyable<ContiguousMemoryInterface>,CopyFromToJavaArray,CopyFromToNIOBuffers,CopyRangeFromToJavaArray,JNAPointerWrappable,MemoryTyped,PointerAccessible,ReadAt,ReadAtAligned,ReadWriteBytesFileChannel,SizedInBytes,WriteAt,WriteAtAligned,Freeable
public class SafeContiguousMemory extends Object implements ContiguousMemoryInterface
SafeContiguousMemory instances wrap instances of ContiguousMemoryInterface and provide range checking for most operations. This is usefull when debugging.- Author:
- royer
-
-
Constructor Summary
Constructors Constructor Description SafeContiguousMemory(ContiguousMemoryInterface pContiguousMemoryInterface)Constructs a SafeContiguousMemory by wrapping a ContiguousMemoryInterface.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcomplainIfFreed()Throws an exception when the object is freed more than once.voidcopyFrom(byte[] pFrom)Copies the content of a byte array to this memory object.voidcopyFrom(byte[] pFrom, int pSrcOffset, long pDstOffset, int pLength)Copies the content of a byte array to this memory object.voidcopyFrom(char[] pFrom)Copies the content of a char array to this memory object.voidcopyFrom(char[] pFrom, int pSrcOffset, long pDstOffset, int pLength)Copies the content of a char array to this memory object.voidcopyFrom(double[] pFrom)Copies the content of a double array to this memory object.voidcopyFrom(double[] pFrom, int pSrcOffset, long pDstOffset, int pLength)Copies the content of a double array to this memory object.voidcopyFrom(float[] pFrom)Copies the content of a float array to this memory object.voidcopyFrom(float[] pFrom, int pSrcOffset, long pDstOffset, int pLength)Copies the content of a float array to this memory object.voidcopyFrom(int[] pFrom)Copies the content of a int array to this memory object.voidcopyFrom(int[] pFrom, int pSrcOffset, long pDstOffset, int pLength)Copies the content of a int array to this memory object.voidcopyFrom(long[] pFrom)Copies the content of a long array to this memory object.voidcopyFrom(long[] pFrom, int pSrcOffset, long pDstOffset, int pLength)Copies the content of a long array to this memory object.voidcopyFrom(short[] pFrom)Copies the content of a short array to this memory object.voidcopyFrom(short[] pFrom, int pSrcOffset, long pDstOffset, int pLength)Copies the content of a short array to this memory object.voidcopyFrom(Buffer pFrom)Copy from NIO buffer.voidcopyFrom(ContiguousMemoryInterface pFrom)Copies an other memory object entirely into this one.voidcopyTo(byte[] pTo)Copies the content of that memory object to a byte array.voidcopyTo(byte[] pTo, long pSrcOffset, int pDstOffset, int pLength)Copies the content of that memory object to a byte array.voidcopyTo(char[] pTo)Copies the content of that memory object to a char array.voidcopyTo(char[] pTo, long pSrcOffset, int pDstOffset, int pLength)Copies the content of that memory object to a char array.voidcopyTo(double[] pTo)Copies the content of that memory object to a double array.voidcopyTo(double[] pTo, long pSrcOffset, int pDstOffset, int pLength)Copies the content of that memory object to a double array.voidcopyTo(float[] pTo)Copies the content of that memory object to a float array.voidcopyTo(float[] pTo, long pSrcOffset, int pDstOffset, int pLength)Copies the content of that memory object to a float array.voidcopyTo(int[] pTo)Copies the content of that memory object to a int array.voidcopyTo(int[] pTo, long pSrcOffset, int pDstOffset, int pLength)Copies the content of that memory object to a int array.voidcopyTo(long[] pTo)Copies the content of that memory object to a long array.voidcopyTo(long[] pTo, long pSrcOffset, int pDstOffset, int pLength)Copies the content of that memory object to a long array.voidcopyTo(short[] pTo)Copies the content of that memory object to a short array.voidcopyTo(short[] pTo, long pSrcOffset, int pDstOffset, int pLength)Copies the content of that memory object to a short array.voidcopyTo(Buffer pTo)Copy to NIO buffer.voidcopyTo(ContiguousMemoryInterface pTo)Copies this memory object entirely into an other.voidfree()Free this object, which means that the underlying ressources are released.longgetAddress()Returns the memory's address.<T> org.bridj.Pointer<T>getBridJPointer(Class<T> pTargetClass)Returns a BridJ pointer for this memory.bytegetByte(long pOffset)Reads a value at a given offset.bytegetByteAligned(long pOffset)Reads a value at a given offset.ByteBuffergetByteBuffer()Returns NIO ByteBufferchargetChar(long pOffset)Reads a value at a given offset.chargetCharAligned(long pOffset)Reads a value at a given offset.doublegetDouble(long pOffset)Reads a value at a given offset.doublegetDoubleAligned(long pOffset)Reads a value at a given offset.floatgetFloat(long pOffset)Reads a value at a given offset.floatgetFloatAligned(long pOffset)Reads a value at a given offset.intgetInt(long pOffset)Reads a value at a given offset.intgetIntAligned(long pOffset)Reads a value at a given offset.com.sun.jna.PointergetJNAPointer()Returns a JNA pointer for this memory.longgetLong(long pOffset)Reads a value at a given offset.longgetLongAligned(long pOffset)Reads a value at a given offset.MemoryTypegetMemoryType()Returns this memory object type.shortgetShort(long pOffset)Reads a value at a given offset.shortgetShortAligned(long pOffset)Reads a value at a given offset.longgetSizeInBytes()Return this memory object's size in bytes.booleanisFree()Returns true if the object has been freed, which usually means that the underlying ressources are not longer available.longreadBytesFromFileChannel(long pBufferPositionInBytes, FileChannel pFileChannel, long pFilePositionInBytes, long pLengthInBytes)longreadBytesFromFileChannel(FileChannel pFileChannel, long pFilePositionInBytes, long pLengthInBytes)Reads data into this memory object for a certain position of a file channel.voidsetByte(long pOffset, byte pValue)Writes a value at a given offset.voidsetByteAligned(long pOffset, byte pValue)Writes a value at a given offset.voidsetChar(long pOffset, char pValue)Writes a value at a given offset.voidsetCharAligned(long pOffset, char pValue)Writes a value at a given offset.voidsetDouble(long pOffset, double pValue)Writes a value at a given offset.voidsetDoubleAligned(long pOffset, double pValue)Writes a value at a given offset.voidsetFloat(long pOffset, float pValue)Writes a value at a given offset.voidsetFloatAligned(long pOffset, float pValue)Writes a value at a given offset.voidsetInt(long pOffset, int pValue)Writes a value at a given offset.voidsetIntAligned(long pOffset, int pValue)Writes a value at a given offset.voidsetLong(long pOffset, long pValue)Writes a value at a given offset.voidsetLongAligned(long pOffset, long pValue)Writes a value at a given offset.voidsetShort(long pOffset, short pValue)Writes a value at a given offset.voidsetShortAligned(long pOffset, short pValue)Writes a value at a given offset.ContiguousMemoryInterfacesubRegion(long pOffset, long pLenghInBytes)Returns a contiguous memory object representing for a memory sub region.static ContiguousMemoryInterfacewrap(ContiguousMemoryInterface pContiguousMemory)Wraps a contiguous memory with a safe facade that does additional access checks.static ContiguousMemoryInterfacewrap(ContiguousMemoryInterface pContiguousMemory, boolean pDoWrap)Wraps a contiguous memory with a safe facade that does additional access checks - but only if the given flag is set to true.longwriteBytesToFileChannel(long pBufferPositionInBytes, FileChannel pFileChannel, long pFilePositionInBytes, long pLengthInBytes)Writes data at a given range from this memory object at a given offset of a file channel.longwriteBytesToFileChannel(FileChannel pFileChannel, long pFilePositionInBytes)Writes the whole contents of this memory object at a given offset of a file channel.
-
-
-
Constructor Detail
-
SafeContiguousMemory
public SafeContiguousMemory(ContiguousMemoryInterface pContiguousMemoryInterface)
Constructs a SafeContiguousMemory by wrapping a ContiguousMemoryInterface.- Parameters:
pContiguousMemoryInterface- contiguous memory to wrap
-
-
Method Detail
-
wrap
public static final ContiguousMemoryInterface wrap(ContiguousMemoryInterface pContiguousMemory)
Wraps a contiguous memory with a safe facade that does additional access checks.- Parameters:
pContiguousMemory- contiguous memory to wrap.- Returns:
- wrapped contiguous memory
-
wrap
public static final ContiguousMemoryInterface wrap(ContiguousMemoryInterface pContiguousMemory, boolean pDoWrap)
Wraps a contiguous memory with a safe facade that does additional access checks - but only if the given flag is set to true.- Parameters:
pContiguousMemory- contiguous memory to wrap.pDoWrap- flag that determines if the wrapping occurs or not- Returns:
- wrapped (or not wrapped) contiguous memory
-
getAddress
public long getAddress()
Description copied from interface:PointerAccessibleReturns the memory's address.- Specified by:
getAddressin interfacePointerAccessible- Returns:
- address
-
getSizeInBytes
public long getSizeInBytes()
Description copied from interface:SizedInBytesReturn this memory object's size in bytes.- Specified by:
getSizeInBytesin interfaceSizedInBytes- Returns:
- size in bytes.
-
getBridJPointer
public <T> org.bridj.Pointer<T> getBridJPointer(Class<T> pTargetClass)
Description copied from interface:BridJPointerWrappableReturns a BridJ pointer for this memory.- Specified by:
getBridJPointerin interfaceBridJPointerWrappable- Type Parameters:
T- ?- Parameters:
pTargetClass- target class- Returns:
- BridJ
-
getJNAPointer
public com.sun.jna.Pointer getJNAPointer()
Description copied from interface:JNAPointerWrappableReturns a JNA pointer for this memory.- Specified by:
getJNAPointerin interfaceJNAPointerWrappable- Returns:
- JNA Pointer
-
getByteBuffer
public ByteBuffer getByteBuffer()
Description copied from interface:ByteBufferWrappableReturns NIO ByteBuffer- Specified by:
getByteBufferin interfaceByteBufferWrappable- Returns:
- NIO ByteBuffer
-
getByteAligned
public byte getByteAligned(long pOffset)
Description copied from interface:ReadAtAlignedReads a value at a given offset. The offset unit is 1 byte.- Specified by:
getByteAlignedin interfaceReadAtAligned- Parameters:
pOffset- offset- Returns:
- value
-
getCharAligned
public char getCharAligned(long pOffset)
Description copied from interface:ReadAtAlignedReads a value at a given offset. The offset unit is 2 bytes (1 char).- Specified by:
getCharAlignedin interfaceReadAtAligned- Parameters:
pOffset- offset- Returns:
- value
-
getShortAligned
public short getShortAligned(long pOffset)
Description copied from interface:ReadAtAlignedReads a value at a given offset. The offset unit is 2 bytes (1 short).- Specified by:
getShortAlignedin interfaceReadAtAligned- Parameters:
pOffset- offset- Returns:
- value
-
getIntAligned
public int getIntAligned(long pOffset)
Description copied from interface:ReadAtAlignedReads a value at a given offset. The offset unit is 4 bytes (1 int).- Specified by:
getIntAlignedin interfaceReadAtAligned- Parameters:
pOffset- offset- Returns:
- value
-
getLongAligned
public long getLongAligned(long pOffset)
Description copied from interface:ReadAtAlignedReads a value at a given offset. The offset unit is 8 bytes (1 long).- Specified by:
getLongAlignedin interfaceReadAtAligned- Parameters:
pOffset- offset- Returns:
- value
-
getFloatAligned
public float getFloatAligned(long pOffset)
Description copied from interface:ReadAtAlignedReads a value at a given offset. The offset unit is 4 bytes (1 float).- Specified by:
getFloatAlignedin interfaceReadAtAligned- Parameters:
pOffset- offset- Returns:
- value
-
getDoubleAligned
public double getDoubleAligned(long pOffset)
Description copied from interface:ReadAtAlignedReads a value at a given offset. The offset unit is 8 bytes (1 double).- Specified by:
getDoubleAlignedin interfaceReadAtAligned- Parameters:
pOffset- offset- Returns:
- value
-
getMemoryType
public MemoryType getMemoryType()
Description copied from interface:MemoryTypedReturns this memory object type.- Specified by:
getMemoryTypein interfaceMemoryTyped- Returns:
- memory type.
-
setByteAligned
public void setByteAligned(long pOffset, byte pValue)Description copied from interface:WriteAtAlignedWrites a value at a given offset. The offset unit is 1 byte.- Specified by:
setByteAlignedin interfaceWriteAtAligned- Parameters:
pOffset- offsetpValue- value to set
-
setCharAligned
public void setCharAligned(long pOffset, char pValue)Description copied from interface:WriteAtAlignedWrites a value at a given offset. The offset unit is 2 bytes (1 char).- Specified by:
setCharAlignedin interfaceWriteAtAligned- Parameters:
pOffset- offsetpValue- value to set
-
setShortAligned
public void setShortAligned(long pOffset, short pValue)Description copied from interface:WriteAtAlignedWrites a value at a given offset. The offset unit is 2 bytes (1 short).- Specified by:
setShortAlignedin interfaceWriteAtAligned- Parameters:
pOffset- offsetpValue- value to set
-
setIntAligned
public void setIntAligned(long pOffset, int pValue)Description copied from interface:WriteAtAlignedWrites a value at a given offset. The offset unit is 4 bytes (1 int).- Specified by:
setIntAlignedin interfaceWriteAtAligned- Parameters:
pOffset- offsetpValue- value to set
-
setLongAligned
public void setLongAligned(long pOffset, long pValue)Description copied from interface:WriteAtAlignedWrites a value at a given offset. The offset unit is 8 bytes (1 long).- Specified by:
setLongAlignedin interfaceWriteAtAligned- Parameters:
pOffset- offsetpValue- value to set
-
setFloatAligned
public void setFloatAligned(long pOffset, float pValue)Description copied from interface:WriteAtAlignedWrites a value at a given offset. The offset unit is 4 bytes (1 float).- Specified by:
setFloatAlignedin interfaceWriteAtAligned- Parameters:
pOffset- offsetpValue- value to set
-
setDoubleAligned
public void setDoubleAligned(long pOffset, double pValue)Description copied from interface:WriteAtAlignedWrites a value at a given offset. The offset unit is 8 bytes (1 double).- Specified by:
setDoubleAlignedin interfaceWriteAtAligned- Parameters:
pOffset- offsetpValue- value to set
-
getByte
public byte getByte(long pOffset)
Description copied from interface:ReadAtReads a value at a given offset.
-
getChar
public char getChar(long pOffset)
Description copied from interface:ReadAtReads a value at a given offset.
-
getShort
public short getShort(long pOffset)
Description copied from interface:ReadAtReads a value at a given offset.
-
getInt
public int getInt(long pOffset)
Description copied from interface:ReadAtReads a value at a given offset.
-
getLong
public long getLong(long pOffset)
Description copied from interface:ReadAtReads a value at a given offset.
-
getFloat
public float getFloat(long pOffset)
Description copied from interface:ReadAtReads a value at a given offset.
-
getDouble
public double getDouble(long pOffset)
Description copied from interface:ReadAtReads a value at a given offset.
-
setByte
public void setByte(long pOffset, byte pValue)Description copied from interface:WriteAtWrites a value at a given offset.
-
setChar
public void setChar(long pOffset, char pValue)Description copied from interface:WriteAtWrites a value at a given offset.
-
setShort
public void setShort(long pOffset, short pValue)Description copied from interface:WriteAtWrites a value at a given offset.
-
setInt
public void setInt(long pOffset, int pValue)Description copied from interface:WriteAtWrites a value at a given offset.
-
setLong
public void setLong(long pOffset, long pValue)Description copied from interface:WriteAtWrites a value at a given offset.
-
setFloat
public void setFloat(long pOffset, float pValue)Description copied from interface:WriteAtWrites a value at a given offset.
-
setDouble
public void setDouble(long pOffset, double pValue)Description copied from interface:WriteAtWrites a value at a given offset.
-
writeBytesToFileChannel
public long writeBytesToFileChannel(FileChannel pFileChannel, long pFilePositionInBytes) throws IOException
Description copied from interface:ReadWriteBytesFileChannelWrites the whole contents of this memory object at a given offset of a file channel.- Specified by:
writeBytesToFileChannelin interfaceReadWriteBytesFileChannel- Parameters:
pFileChannel- file channelpFilePositionInBytes- file position- Returns:
- file position past the last written byte.
- Throws:
IOException- Thrown in case of IO problem.
-
writeBytesToFileChannel
public long writeBytesToFileChannel(long pBufferPositionInBytes, FileChannel pFileChannel, long pFilePositionInBytes, long pLengthInBytes) throws IOExceptionDescription copied from interface:ReadWriteBytesFileChannelWrites data at a given range from this memory object at a given offset of a file channel.- Specified by:
writeBytesToFileChannelin interfaceReadWriteBytesFileChannel- Parameters:
pBufferPositionInBytes- offset in memory objectpFileChannel- file channelpFilePositionInBytes- file channel offsetpLengthInBytes- 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:ReadWriteBytesFileChannelReads data into this memory object for a certain position of a file channel.- Specified by:
readBytesFromFileChannelin interfaceReadWriteBytesFileChannel- Parameters:
pFileChannel- file channelpFilePositionInBytes- offset in file channelpLengthInBytes- length in bytes- Returns:
- File position past the last byte read.
- Throws:
IOException- Thrown in case of IO problem.
-
readBytesFromFileChannel
public long readBytesFromFileChannel(long pBufferPositionInBytes, FileChannel pFileChannel, long pFilePositionInBytes, long pLengthInBytes) throws IOException- Specified by:
readBytesFromFileChannelin interfaceReadWriteBytesFileChannel- Parameters:
pBufferPositionInBytes- offset in memory objectpFileChannel- file channelpFilePositionInBytes- offset in file channelpLengthInBytes- length in bytes- Returns:
- File position past the last byte read.
- Throws:
IOException- Thrown in case of IO problem.
-
free
public void free()
Description copied from interface:FreeableFree this object, which means that the underlying ressources are released.
-
isFree
public boolean isFree()
Description copied from interface:FreeableReturns true if the object has been freed, which usually means that the underlying ressources are not longer available.
-
complainIfFreed
public void complainIfFreed() throws FreedExceptionDescription copied from interface:FreeableThrows an exception when the object is freed more than once.- Specified by:
complainIfFreedin interfaceFreeable- Throws:
FreedException- exception thrown
-
subRegion
public ContiguousMemoryInterface subRegion(long pOffset, long pLenghInBytes)
Description copied from interface:ContiguousMemoryInterfaceReturns a contiguous memory object representing for a memory sub region.- Specified by:
subRegionin interfaceContiguousMemoryInterface- Parameters:
pOffset- offset in bytespLenghInBytes- length in bytes- Returns:
- contiguous memory for sub region
-
copyTo
public void copyTo(Buffer pTo)
Description copied from interface:CopyFromToNIOBuffersCopy to NIO buffer.- Specified by:
copyToin interfaceCopyFromToNIOBuffers- Parameters:
pTo- NIO buffer
-
copyFrom
public void copyFrom(Buffer pFrom)
Description copied from interface:CopyFromToNIOBuffersCopy from NIO buffer.- Specified by:
copyFromin interfaceCopyFromToNIOBuffers- Parameters:
pFrom- NIO buffer
-
copyTo
public void copyTo(ContiguousMemoryInterface pTo)
Description copied from interface:CopyableCopies this memory object entirely into an other.- Specified by:
copyToin interfaceCopyable<ContiguousMemoryInterface>- Parameters:
pTo- object to copy to
-
copyFrom
public void copyFrom(ContiguousMemoryInterface pFrom)
Description copied from interface:CopyableCopies an other memory object entirely into this one.- Specified by:
copyFromin interfaceCopyable<ContiguousMemoryInterface>- Parameters:
pFrom- object to copy from
-
copyTo
public void copyTo(byte[] pTo)
Description copied from interface:CopyFromToJavaArrayCopies the content of that memory object to a byte array.- Specified by:
copyToin interfaceCopyFromToJavaArray- Parameters:
pTo- preallocated byte array.
-
copyTo
public void copyTo(short[] pTo)
Description copied from interface:CopyFromToJavaArrayCopies the content of that memory object to a short array.- Specified by:
copyToin interfaceCopyFromToJavaArray- Parameters:
pTo- preallocated short array.
-
copyTo
public void copyTo(char[] pTo)
Description copied from interface:CopyFromToJavaArrayCopies the content of that memory object to a char array.- Specified by:
copyToin interfaceCopyFromToJavaArray- Parameters:
pTo- preallocated char array.
-
copyTo
public void copyTo(int[] pTo)
Description copied from interface:CopyFromToJavaArrayCopies the content of that memory object to a int array.- Specified by:
copyToin interfaceCopyFromToJavaArray- Parameters:
pTo- preallocated int array.
-
copyTo
public void copyTo(long[] pTo)
Description copied from interface:CopyFromToJavaArrayCopies the content of that memory object to a long array.- Specified by:
copyToin interfaceCopyFromToJavaArray- Parameters:
pTo- preallocated long array.
-
copyTo
public void copyTo(float[] pTo)
Description copied from interface:CopyFromToJavaArrayCopies the content of that memory object to a float array.- Specified by:
copyToin interfaceCopyFromToJavaArray- Parameters:
pTo- preallocated float array.
-
copyTo
public void copyTo(double[] pTo)
Description copied from interface:CopyFromToJavaArrayCopies the content of that memory object to a double array.- Specified by:
copyToin interfaceCopyFromToJavaArray- Parameters:
pTo- preallocated double array.
-
copyFrom
public void copyFrom(byte[] pFrom)
Description copied from interface:CopyFromToJavaArrayCopies the content of a byte array to this memory object.- Specified by:
copyFromin interfaceCopyFromToJavaArray- Parameters:
pFrom- preallocated byte array.
-
copyFrom
public void copyFrom(short[] pFrom)
Description copied from interface:CopyFromToJavaArrayCopies the content of a short array to this memory object.- Specified by:
copyFromin interfaceCopyFromToJavaArray- Parameters:
pFrom- preallocated short array.
-
copyFrom
public void copyFrom(char[] pFrom)
Description copied from interface:CopyFromToJavaArrayCopies the content of a char array to this memory object.- Specified by:
copyFromin interfaceCopyFromToJavaArray- Parameters:
pFrom- preallocated char array.
-
copyFrom
public void copyFrom(int[] pFrom)
Description copied from interface:CopyFromToJavaArrayCopies the content of a int array to this memory object.- Specified by:
copyFromin interfaceCopyFromToJavaArray- Parameters:
pFrom- preallocated int array.
-
copyFrom
public void copyFrom(long[] pFrom)
Description copied from interface:CopyFromToJavaArrayCopies the content of a long array to this memory object.- Specified by:
copyFromin interfaceCopyFromToJavaArray- Parameters:
pFrom- preallocated long array.
-
copyFrom
public void copyFrom(float[] pFrom)
Description copied from interface:CopyFromToJavaArrayCopies the content of a float array to this memory object.- Specified by:
copyFromin interfaceCopyFromToJavaArray- Parameters:
pFrom- preallocated float array.
-
copyFrom
public void copyFrom(double[] pFrom)
Description copied from interface:CopyFromToJavaArrayCopies the content of a double array to this memory object.- Specified by:
copyFromin interfaceCopyFromToJavaArray- Parameters:
pFrom- preallocated double array.
-
copyTo
public void copyTo(byte[] pTo, long pSrcOffset, int pDstOffset, int pLength)Description copied from interface:CopyRangeFromToJavaArrayCopies the content of that memory object to a byte array.- Specified by:
copyToin interfaceCopyRangeFromToJavaArray- 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:CopyRangeFromToJavaArrayCopies the content of that memory object to a short array.- Specified by:
copyToin interfaceCopyRangeFromToJavaArray- 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:CopyRangeFromToJavaArrayCopies the content of that memory object to a char array.- Specified by:
copyToin interfaceCopyRangeFromToJavaArray- 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:CopyRangeFromToJavaArrayCopies the content of that memory object to a int array.- Specified by:
copyToin interfaceCopyRangeFromToJavaArray- 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:CopyRangeFromToJavaArrayCopies the content of that memory object to a long array.- Specified by:
copyToin interfaceCopyRangeFromToJavaArray- 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:CopyRangeFromToJavaArrayCopies the content of that memory object to a float array.- Specified by:
copyToin interfaceCopyRangeFromToJavaArray- 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:CopyRangeFromToJavaArrayCopies the content of that memory object to a double array.- Specified by:
copyToin interfaceCopyRangeFromToJavaArray- 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:CopyRangeFromToJavaArrayCopies the content of a byte array to this memory object.- Specified by:
copyFromin interfaceCopyRangeFromToJavaArray- 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:CopyRangeFromToJavaArrayCopies the content of a short array to this memory object.- Specified by:
copyFromin interfaceCopyRangeFromToJavaArray- 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:CopyRangeFromToJavaArrayCopies the content of a char array to this memory object.- Specified by:
copyFromin interfaceCopyRangeFromToJavaArray- 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:CopyRangeFromToJavaArrayCopies the content of a int array to this memory object.- Specified by:
copyFromin interfaceCopyRangeFromToJavaArray- 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:CopyRangeFromToJavaArrayCopies the content of a long array to this memory object.- Specified by:
copyFromin interfaceCopyRangeFromToJavaArray- 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:CopyRangeFromToJavaArrayCopies the content of a float array to this memory object.- Specified by:
copyFromin interfaceCopyRangeFromToJavaArray- 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:CopyRangeFromToJavaArrayCopies the content of a double array to this memory object.- Specified by:
copyFromin interfaceCopyRangeFromToJavaArray- Parameters:
pFrom- preallocated double array.pSrcOffset- source offset (array elements)pDstOffset- destination offset (array elements)pLength- length in array elements
-
-