com.neva
Class ExternalObject

java.lang.Object
  |
  +--com.neva.ExternalObject

public class ExternalObject
extends java.lang.Object

Class ExternalObject provides the protocol for manipulating memory blocks allocated outside Java sandbox.


Constructor Summary
ExternalObject()
          Creates an ExternalObject
ExternalObject(boolean e)
          Creates an ExternalObject from Boolean
ExternalObject(byte[] e, int size)
          Creates an ExternalObject from a byte array.
ExternalObject(int e)
          Creates an ExternalObject from integer
ExternalObject(java.lang.String e)
          Creates an ExternalObject from a String.
 
Method Summary
 int getLength()
          Answers the length attribute of an ExternalObject.
 int getValue()
          Answers the value attribute of an ExternalObject.
 void setLength(int len)
          Sets the length attribute.
 void setValue(int val)
          Sets the value attribute.
 byte[] valueAsByteArray(int size)
          Moves size bytes from the external heap and answers them as a byte array.
 java.lang.String valueAsString()
          Moves bytes from the external heap up to 0x00 byte and answers them as a Java String
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ExternalObject

public ExternalObject()
Creates an ExternalObject


ExternalObject

public ExternalObject(boolean e)
Creates an ExternalObject from Boolean


ExternalObject

public ExternalObject(byte[] e,
                      int size)
Creates an ExternalObject from a byte array. Bytes are being copied to an external memory and the pointer is being stored in the value attribute. When this object is being GC'ed, the memory is freed.


ExternalObject

public ExternalObject(int e)
Creates an ExternalObject from integer


ExternalObject

public ExternalObject(java.lang.String e)
Creates an ExternalObject from a String. String bytes are being copied to an external memory and the pointer is being stored in the value attribute. When this object is being GC'ed, the memory is freed.

Method Detail

getLength

public int getLength()
Answers the length attribute of an ExternalObject.


getValue

public int getValue()
Answers the value attribute of an ExternalObject.


setLength

public void setLength(int len)
Sets the length attribute.


setValue

public void setValue(int val)
Sets the value attribute.


valueAsByteArray

public byte[] valueAsByteArray(int size)
                        throws java.lang.NullPointerException
Moves size bytes from the external heap and answers them as a byte array.

java.lang.NullPointerException

valueAsString

public java.lang.String valueAsString()
                               throws java.lang.NullPointerException
Moves bytes from the external heap up to 0x00 byte and answers them as a Java String

java.lang.NullPointerException