public class BlockHeader
extends java.lang.Object
File-blocks contain a file-block-header and data. The start of a file-block is always implicitly aligned at 4 bytes. The file-block-header describes the total length of the data, the type of information stored in the file-block, the number of items of this information and the old memory pointer at the moment the data was written to disk. Depending on the pointer-size stored in the file-header, a file-block-header can be 20 or 24 bytes long.
Each block has a block code (see BlockCodes
).
The type of data stored in the block is determined by the
sdnaIndex
. This is the index of the type information
stored in StructDNA.structs
. Thus, you always have to
decode the StructDNA
first before you can read other data.
Constructor and Description |
---|
BlockHeader() |
BlockHeader(Identifier code,
int size,
long address) |
BlockHeader(Identifier code,
int size,
long address,
int sdnaIndex,
int count) |
Modifier and Type | Method and Description |
---|---|
long |
getAddress() |
Identifier |
getCode() |
int |
getCount() |
static long |
getHeaderSize(int pointerSize) |
int |
getSdnaIndex() |
int |
getSize() |
void |
read(CDataReadWriteAccess in) |
void |
setCount(int count) |
void |
setSdnaIndex(int sdnaIndex) |
java.lang.String |
toString() |
void |
write(CDataReadWriteAccess out) |
public BlockHeader()
public BlockHeader(Identifier code, int size, long address)
public BlockHeader(Identifier code, int size, long address, int sdnaIndex, int count)
public void read(CDataReadWriteAccess in) throws java.io.IOException
java.io.IOException
public void write(CDataReadWriteAccess out) throws java.io.IOException
java.io.IOException
public Identifier getCode()
public int getSize()
public long getAddress()
public int getSdnaIndex()
public void setSdnaIndex(int sdnaIndex)
public int getCount()
public void setCount(int count)
public java.lang.String toString()
toString
in class java.lang.Object
public static long getHeaderSize(int pointerSize)