Constructor and Description |
---|
BlockTable()
Creates an empty block table.
|
Modifier and Type | Method and Description |
---|---|
void |
add(BlockEntry blockEntry,
Block block)
Adds a block to this block table.
|
static BlockTable |
create(java.io.InputStream in)
Creates this object from an input stream, expecting its byte representation.
|
void |
fromBytes(byte[] data)
Reads this object's representation from a byte array.
|
Block |
get(BlockEntry blockEntry)
Gets a matching block for this block entry.
|
java.lang.Iterable<java.util.Map.Entry<BlockEntry,Block>> |
getEntries() |
void |
readBytes(java.io.InputStream in)
Imports this object from bytes.
|
byte[] |
toBytes()
Gets this object's representation as bytes.
|
void |
writeBytes(java.io.OutputStream out)
Exports this object to bytes.
|
public static BlockTable create(java.io.InputStream in) throws java.io.IOException
in
- the input stream to read from.java.io.IOException
- if a read error occurs.public void add(BlockEntry blockEntry, Block block)
blockEntry
- the block entry descriptor.block
- the block that is associated with the entry.public Block get(BlockEntry blockEntry)
blockEntry
- the block entry descriptor.public java.lang.Iterable<java.util.Map.Entry<BlockEntry,Block>> getEntries()
public void writeBytes(java.io.OutputStream out) throws java.io.IOException
Saveable
writeBytes
in interface Saveable
out
- the output stream to write to.java.io.IOException
- if a write problem occurs.public void readBytes(java.io.InputStream in) throws java.io.IOException
Saveable
public byte[] toBytes() throws java.io.IOException
Saveable
public void fromBytes(byte[] data) throws java.io.IOException
Saveable