Sun SPOT API
Green Release  


com.sun.squawk
Class FlashObjectMemoryLoader

java.lang.Object
  extended by com.sun.squawk.ObjectMemoryLoader
      extended by com.sun.squawk.FlashObjectMemoryLoader

public class FlashObjectMemoryLoader
extends ObjectMemoryLoader

Author:
Dave

Field Summary
 
Fields inherited from class com.sun.squawk.ObjectMemoryLoader
reader
 
Constructor Summary
FlashObjectMemoryLoader(com.sun.squawk.ObjectMemoryReader reader, boolean loadIntoReadOnlyMemory)
           
 
Method Summary
static int getByte(int i)
           
protected  int getHash(byte[] dummy)
          Calculates the hash of an array of bytes.
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 com.sun.squawk.ObjectMemoryLoader
hash, load, loadHeader
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FlashObjectMemoryLoader

public FlashObjectMemoryLoader(com.sun.squawk.ObjectMemoryReader reader,
                               boolean loadIntoReadOnlyMemory)
Parameters:
reader -
loadIntoReadOnlyMemory -
Method Detail

loadMemory

protected byte[] loadMemory(int size)
Description copied from class: ObjectMemoryLoader
Loads the 'memory' component of the object memory from the input stream.

Overrides:
loadMemory in class ObjectMemoryLoader
Parameters:
size - the size of memory as specified by the 'size' element of the objct memory
Returns:
the contents of the 'memory' component

getHash

protected int getHash(byte[] dummy)
Description copied from class: ObjectMemoryLoader
Calculates the hash of an array of bytes.

Overrides:
getHash in class ObjectMemoryLoader
Parameters:
dummy - the byte array to hash
Returns:
the hash of arr

skipMemoryPadding

protected void skipMemoryPadding(String parentURI,
                                 int memorySize)
Description copied from class: ObjectMemoryLoader
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.

Overrides:
skipMemoryPadding in class ObjectMemoryLoader
Parameters:
parentURI - the value of the 'parent_uri' item in the object memory file
memorySize - the value of the 'size' item in the object memory file

relocateMemory

protected Address relocateMemory(ObjectMemory parent,
                                 byte[] buffer,
                                 BitSet oopMap)
Description copied from class: ObjectMemoryLoader
Relocates the memory.

Overrides:
relocateMemory in class ObjectMemoryLoader
Parameters:
parent - the loaded/resolved parent object memory
buffer - the contents of the 'memory' component
oopMap - the bit set encapsulating the 'oopmap' component
Returns:
the address of the relocated memory buffer

loadOopMap

protected BitSet loadOopMap(int size)
Description copied from class: ObjectMemoryLoader
Loads the 'oopmap' component of the object memory from the input stream.

Overrides:
loadOopMap in class ObjectMemoryLoader
Parameters:
size - the size of memory as specified by the 'size' element of the objct memory
Returns:
the bit set encapsulating the oop map

getByte

public static int getByte(int i)
Parameters:
i -

Sun SPOT API
Green Release  


Copyright © 2006 Sun Microsystems, Inc. All Rights Reserved.