|
" 2013 FRC Java API " |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.sun.squawk.ObjectMemoryLoader
public class ObjectMemoryLoader
This class facilitates loading a serialized object graph from a URI and relocating it.
Method Summary | |
---|---|
static void |
addFilePath(String path)
Expecting a string that looks something like "c:\dev\1${File.separatorChar}c:\windows". |
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 |
load(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. |
static void |
setFilePath(String path)
Expecting a string that looks something like "c:\dev\1${File.separatorChar}c:\windows". |
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, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
protected int getHash(byte[] arr)
arr
- the byte array to hash
arr
public 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
public static ObjectMemoryFile load(String uri, boolean loadIntoReadOnlyMemory) throws IOException
uri
- a URI identifying the object memory being loadedloadIntoReadOnlyMemory
- specifies if the object memory should be put into read-only memory
IOException
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 filepublic static void addFilePath(String path)
path
- entriespublic static void setFilePath(String path)
path
- entriesprotected 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
|
" 2013 FRC Java API " |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |