jnr.ffi.provider.jffi
Class ByteBufferMemoryIO

java.lang.Object
  extended by jnr.ffi.Pointer
      extended by jnr.ffi.provider.AbstractMemoryIO
          extended by jnr.ffi.provider.AbstractBufferMemoryIO
              extended by jnr.ffi.provider.jffi.ByteBufferMemoryIO

public class ByteBufferMemoryIO
extends AbstractBufferMemoryIO


Field Summary
 
Fields inherited from class jnr.ffi.provider.AbstractBufferMemoryIO
buffer
 
Constructor Summary
ByteBufferMemoryIO(NativeRuntime runtime, ByteBuffer buffer)
           
 
Method Summary
 long address()
          Gets the native address of this memory object (optional operation).
 Pointer getPointer(long offset)
          Reads an Pointer value at the given offset.
 Pointer getPointer(long offset, long size)
          Reads an Pointer value at the given offset.
 void putPointer(long offset, Pointer value)
          Writes a Pointer value at the given offset.
 
Methods inherited from class jnr.ffi.provider.AbstractBufferMemoryIO
array, arrayLength, arrayOffset, get, get, get, get, get, get, getByte, getByteBuffer, getDouble, getFloat, getInt, getLongLong, getShort, getString, getString, getString, hasArray, indexOf, isDirect, put, put, put, put, put, put, putByte, putDouble, putFloat, putInt, putLongLong, putShort, putString, putString, setMemory, size
 
Methods inherited from class jnr.ffi.provider.AbstractMemoryIO
checkBounds, checkBounds, getAddress, getInt, getLong, getNativeLong, getRuntime, indexOf, putAddress, putAddress, putInt, putLong, putNativeLong, slice, slice, transferFrom, transferTo
 
Methods inherited from class jnr.ffi.Pointer
get, getNullTerminatedPointerArray, getNullTerminatedStringArray, newIntPointer, put, wrap, wrap, wrap
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ByteBufferMemoryIO

public ByteBufferMemoryIO(NativeRuntime runtime,
                          ByteBuffer buffer)
Method Detail

getPointer

public Pointer getPointer(long offset)
Description copied from class: Pointer
Reads an Pointer value at the given offset.

Specified by:
getPointer in class Pointer
Parameters:
offset - the offset from the start of the memory this Pointer represents at which the value will be read.
Returns:
the Pointer value read from memory.

getPointer

public Pointer getPointer(long offset,
                          long size)
Description copied from class: Pointer
Reads an Pointer value at the given offset.

Specified by:
getPointer in class Pointer
Parameters:
offset - the offset from the start of the memory this Pointer represents at which the value will be read.
size - the maximum size of the memory location the returned Pointer represents.
Returns:
the Pointer value read from memory.

putPointer

public void putPointer(long offset,
                       Pointer value)
Description copied from class: Pointer
Writes a Pointer value at the given offset.

Specified by:
putPointer in class Pointer
Parameters:
offset - The offset from the start of the memory this Pointer represents at which the value will be written.
value - the Pointer value to be written to memory.

address

public long address()
Description copied from class: Pointer
Gets the native address of this memory object (optional operation).

Specified by:
address in class Pointer
Returns:
the native address of this memory object. If this object is not a native memory address, an address of zero is returned.


Copyright © 2012. All Rights Reserved.