Class 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 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 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
      • 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 class java.lang.Object
      • getHeaderSize

        public static long getHeaderSize​(int pointerSize)