All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.khubla.pdxreader.db.DBTableBlockHeader Maven / Gradle / Ivy

The newest version!
package com.khubla.pdxreader.db;

import com.google.common.io.LittleEndianDataInputStream;
import com.khubla.pdxreader.api.PDXReaderException;

/**
 * @author tom
 */
public class DBTableBlockHeader {
   private int nextBlockNumber;
   private int previousBlockNumber;
   private int offsetLastRecord;

   public int getNextBlockNumber() {
      return nextBlockNumber;
   }

   public int getOffsetLastRecord() {
      return offsetLastRecord;
   }

   public int getPreviousBlockNumber() {
      return previousBlockNumber;
   }

   /**
    * block header, 6 bytes
    */
   public void read(LittleEndianDataInputStream littleEndianDataInputStream) throws PDXReaderException {
      try {
         nextBlockNumber = littleEndianDataInputStream.readUnsignedShort();
         previousBlockNumber = littleEndianDataInputStream.readUnsignedShort();
         offsetLastRecord = littleEndianDataInputStream.readUnsignedShort();
      } catch (final Exception e) {
         throw new PDXReaderException("Exception in read", e);
      }
   }

   public void setNextBlockNumber(int nextBlockNumber) {
      this.nextBlockNumber = nextBlockNumber;
   }

   public void setOffsetLastRecord(int offsetLastRecord) {
      this.offsetLastRecord = offsetLastRecord;
   }

   public void setPreviousBlockNumber(int previousBlockNumber) {
      this.previousBlockNumber = previousBlockNumber;
   }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy