Package org.cakelab.blender.io.block
Class BlockHeader
- java.lang.Object
-
- org.cakelab.blender.io.block.BlockHeader
-
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 thesdnaIndex
. This is the index of the type information stored inStructDNA.structs
. Thus, you always have to decode theStructDNA
first before you can read other data.
-
-
Constructor Summary
Constructors Constructor Description BlockHeader()
BlockHeader(Identifier code, int size, long address)
BlockHeader(Identifier code, int size, long address, int sdnaIndex, int count)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method 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)
-
-
-
Constructor Detail
-
BlockHeader
public BlockHeader()
-
BlockHeader
public BlockHeader(Identifier code, int size, long address)
-
BlockHeader
public BlockHeader(Identifier code, int size, long address, int sdnaIndex, int count)
-
-
Method Detail
-
read
public void read(CDataReadWriteAccess in) throws java.io.IOException
- Throws:
java.io.IOException
-
write
public void write(CDataReadWriteAccess out) throws java.io.IOException
- Throws:
java.io.IOException
-
getCode
public Identifier getCode()
-
getSize
public int getSize()
-
getAddress
public long getAddress()
-
getSdnaIndex
public int getSdnaIndex()
-
setSdnaIndex
public void setSdnaIndex(int sdnaIndex)
-
getCount
public int getCount()
-
setCount
public void setCount(int count)
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
getHeaderSize
public static long getHeaderSize(int pointerSize)
-
-