Home | History | Annotate | Download | only in index
      1 /*
      2  * BlockInfo
      3  *
      4  * Author: Lasse Collin <lasse.collin (at) tukaani.org>
      5  *
      6  * This file has been put into the public domain.
      7  * You can do whatever you want with this file.
      8  */
      9 
     10 package org.tukaani.xz.index;
     11 
     12 import org.tukaani.xz.common.StreamFlags;
     13 
     14 public class BlockInfo {
     15     public int blockNumber = -1;
     16     public long compressedOffset = -1;
     17     public long uncompressedOffset = -1;
     18     public long unpaddedSize = -1;
     19     public long uncompressedSize = -1;
     20 
     21     IndexDecoder index;
     22 
     23     public BlockInfo(IndexDecoder indexOfFirstStream) {
     24         index = indexOfFirstStream;
     25     }
     26 
     27     public int getCheckType() {
     28         return index.getStreamFlags().checkType;
     29     }
     30 
     31     public boolean hasNext() {
     32         return index.hasRecord(blockNumber + 1);
     33     }
     34 
     35     public void setNext() {
     36         index.setBlockInfo(this, blockNumber + 1);
     37     }
     38 }
     39