|
Sun SPOT API |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.sun.squawk.ObjectMemoryLoader
public class ObjectMemoryLoader
This class facilitates loading a serialized object graph from a URI and relocating it.
| Field Summary | |
|---|---|
protected com.sun.squawk.ObjectMemoryReader |
reader
The validating reader used to read the components of an object memory from an input stream. |
| Constructor Summary | |
|---|---|
protected |
ObjectMemoryLoader(com.sun.squawk.ObjectMemoryReader reader,
boolean loadIntoReadOnlyMemory)
Constructor. |
| Method Summary | |
|---|---|
protected int |
getHash(byte[] arr)
Calculates the hash of an array of bytes. |
static int |
hash(byte[] arr)
|
static ObjectMemoryFile |
load(DataInputStream dis,
String uri,
boolean loadIntoReadOnlyMemory)
Loads an object memory from a given input stream. |
static ObjectMemoryFile |
loadHeader(DataInputStream dis,
String uri)
Loads the header of an object memory file from a given input stream. |
protected byte[] |
loadMemory(int size)
Loads the 'memory' component of the object memory from the input stream. |
protected BitSet |
loadOopMap(int size)
Loads the 'oopmap' component of the object memory from the input stream. |
protected Address |
relocateMemory(ObjectMemory parent,
byte[] buffer,
BitSet oopMap)
Relocates the memory. |
protected void |
skipMemoryPadding(String parentURI,
int memorySize)
Skips the padding that precedes the 'memory' item to ensure that it is word aligned with respect to the start of the object memory file. |
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected final com.sun.squawk.ObjectMemoryReader reader
| Constructor Detail |
|---|
protected ObjectMemoryLoader(com.sun.squawk.ObjectMemoryReader reader,
boolean loadIntoReadOnlyMemory)
reader - loadIntoReadOnlyMemory - | Method Detail |
|---|
protected int getHash(byte[] arr)
arr - the byte array to hash
arrpublic static int hash(byte[] arr)
public static ObjectMemoryFile loadHeader(DataInputStream dis,
String uri)
dis - the data input stream from which to readuri - a URI identifying the object memory being loaded
ObjectMemoryFile.objectMemory field is null)
public static ObjectMemoryFile load(DataInputStream dis,
String uri,
boolean loadIntoReadOnlyMemory)
dis - the data input stream from which to readuri - a URI identifying the object memory being loadedloadIntoReadOnlyMemory - specifies if the object memory should be put into read-only memory
protected void skipMemoryPadding(String parentURI,
int memorySize)
parentURI - the value of the 'parent_uri' item in the object memory filememorySize - the value of the 'size' item in the object memory fileprotected BitSet loadOopMap(int size)
size - the size of memory as specified by the 'size' element of the objct memory
protected byte[] loadMemory(int size)
size - the size of memory as specified by the 'size' element of the objct memory
protected Address relocateMemory(ObjectMemory parent,
byte[] buffer,
BitSet oopMap)
parent - the loaded/resolved parent object memorybuffer - the contents of the 'memory' componentoopMap - the bit set encapsulating the 'oopmap' component
|
Sun SPOT API |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||