JNative project : see http://jnative.sf.net


org.xvolks.jnative.pointers.memory
Interface MemoryBlock

All Known Implementing Classes:
AbstractMemoryBlock, GlobalMemoryBlock, HeapMemoryBlock, NativeMemoryBlock

public interface MemoryBlock

$Id: MemoryBlock.java,v 1.3 2006/01/21 21:21:45 mdenty Exp $

This interface represents a block of native memory

This software is released under the GPL.


Method Summary
 void dispose()
          Method dispose provides a way to free the memory
 java.lang.Integer getPointer()
          Method getPointer
 int getSize()
          Method getSize
 int reserveMemory(int size)
          Method reserveMemory allocate a block of native memory
 

Method Detail

getPointer

java.lang.Integer getPointer()
                             throws java.lang.NullPointerException
Method getPointer

Returns:
the pointer that addresses the memory block
Throws:
java.lang.NullPointerException - if the pointer is null

getSize

int getSize()
            throws java.lang.NullPointerException
Method getSize

Returns:
the size of this memory block
Throws:
java.lang.NullPointerException - if the pointer is null

reserveMemory

int reserveMemory(int size)
                  throws NativeException
Method reserveMemory allocate a block of native memory

Parameters:
size - in bytes of the block
Returns:
the address of the reserved memory
Throws:
NativeException

dispose

void dispose()
             throws NativeException
Method dispose provides a way to free the memory

Throws:
NativeException

JNative project : see http://jnative.sf.net