|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.xith3d.io.Archive
public class Archive
An archive is a flexible and high performance storage system for Scribable objects. Objects can be stored and retrieved by name. The archive can grow as needed. Objects can be deleted and/or replaced. You can also get an iterator to step through the objects sequentially. Each object can be stored compressed or uncompressed. The file is organized as follows: The first entry in the file is a directory block. Each directory block is 20,000 bytes. We cram as many DirEntry as possible into each 20k chunk. Assuming around an average of 30 bytes per entry this is about 600 entries per block. Each free block contains two longs, one is the length of the block and the other is a link to the next free block.
| Constructor Summary | |
|---|---|
Archive(java.lang.String filename,
boolean readonly)
Creates an Archive object. |
|
| Method Summary | |
|---|---|
void |
close()
Writes the directory, free list and closes the file. |
int |
compare(java.lang.String a,
java.lang.String b)
Compares two keys together |
boolean |
exists(java.lang.String name)
|
Scribable |
read(java.lang.String name)
Writes out the object to the repository. |
void |
remove(java.lang.String name)
Removes an entry from the repository |
void |
write(java.lang.String name,
Scribable object,
boolean compress)
Writes out the object to the repository. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface java.util.Comparator |
|---|
equals |
| Constructor Detail |
|---|
public Archive(java.lang.String filename,
boolean readonly)
throws java.io.IOException
filename - The name of the filereadonly - True if the file should not be written to
java.io.IOException| Method Detail |
|---|
public boolean exists(java.lang.String name)
public void close()
throws java.io.IOException
java.io.IOException
public int compare(java.lang.String a,
java.lang.String b)
compare in interface java.util.Comparator<java.lang.String>
public void write(java.lang.String name,
Scribable object,
boolean compress)
throws java.io.IOException,
UnscribableNodeEncountered
object -
java.io.IOException
UnscribableNodeEncountered
public Scribable read(java.lang.String name)
throws java.io.IOException,
InvalidFormat
name -
java.io.IOException
InvalidFormatpublic void remove(java.lang.String name)
name -
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||