Logo Search packages:      
Sourcecode: libjna-java version File versions  Download package

com::sun::jna::Memory Class Reference

Inheritance diagram for com::sun::jna::Memory:

com::sun::jna::Pointer com::sun::jna::Memory::SharedMemory com::sun::jna::StringArray

List of all members.


Detailed Description

A Pointer to memory obtained from the native heap via a call to malloc.

In some cases it might be necessary to use memory obtained from malloc. For example, Memory helps accomplish the following idiom:

 		void *buf = malloc(BUF_LEN * sizeof(char));
		call_some_function(buf);
		free(buf);
 

The finalize method will free allocated memory when this object is no longer referenced.

Author:
Sheng Liang, originator

Todd Fast, suitability modifications

Timothy Wall

See also:
Pointer

Definition at line 37 of file Memory.java.


Public Member Functions

Pointer align (int byteBoundary)
void clear ()
boolean equals (Object o)
byte getByte (long offset)
byte[] getByteArray (long offset, int arraySize)
ByteBuffer getByteBuffer (long offset, long length)
char getChar (long offset)
char[] getCharArray (long offset, int arraySize)
double getDouble (long offset)
double[] getDoubleArray (long offset, int arraySize)
float getFloat (long offset)
float[] getFloatArray (long offset, int arraySize)
int getInt (long offset)
int[] getIntArray (long offset, int arraySize)
long getLong (long offset)
long[] getLongArray (long offset, int arraySize)
NativeLong getNativeLong (long offset)
Pointer getPointer (long offset)
Pointer[] getPointerArray (long offset, int arraySize)
short getShort (long offset)
short[] getShortArray (long offset, int arraySize)
long getSize ()
String getString (long offset)
String getString (long offset, boolean wide)
int hashCode ()
long indexOf (long offset, byte value)
boolean isValid ()
 Memory (long size)
void read (long offset, Pointer[] buf, int index, int length)
void read (long bOff, double[] buf, int index, int length)
void read (long bOff, float[] buf, int index, int length)
void read (long bOff, long[] buf, int index, int length)
void read (long bOff, int[] buf, int index, int length)
void read (long bOff, char[] buf, int index, int length)
void read (long bOff, short[] buf, int index, int length)
void read (long bOff, byte[] buf, int index, int length)
void setByte (long offset, byte value)
void setChar (long offset, char value)
void setDouble (long offset, double value)
void setFloat (long offset, float value)
void setInt (long offset, int value)
void setLong (long offset, long value)
void setMemory (long offset, long length, byte value)
void setNativeLong (long offset, NativeLong value)
void setPointer (long offset, Pointer value)
void setShort (long offset, short value)
void setString (long offset, String value)
void setString (long offset, String value, boolean wide)
Pointer share (long offset, long sz)
Pointer share (long offset)
String toString ()
void write (long bOff, Pointer[] buf, int index, int length)
void write (long bOff, double[] buf, int index, int length)
void write (long bOff, float[] buf, int index, int length)
void write (long bOff, long[] buf, int index, int length)
void write (long bOff, int[] buf, int index, int length)
void write (long bOff, char[] buf, int index, int length)
void write (long bOff, short[] buf, int index, int length)
void write (long bOff, byte[] buf, int index, int length)

Static Public Member Functions

static final Pointer createConstant (long peer)

Static Public Attributes

static final Pointer NULL = null
static final int SIZE

Protected Member Functions

void boundsCheck (long off, long sz)
void finalize ()

Protected Attributes

long size

Package Functions

void clear (long size)

Static Package Functions

 [static initializer]
static native void free (long ptr)
static native long malloc (long size)

Package Attributes

long peer

Classes

class  SharedMemory

The documentation for this class was generated from the following file:

Generated by  Doxygen 1.6.0   Back to index