code: private void processBlocks(DataInputStream in, ImageVisitor v,
        int numBlocks, boolean skipBlocks) throws IOException {
      v.visitEnclosingElement(ImageElement.BLOCKS,
                              ImageElement.NUM_BLOCKS, numBlocks);
      
      // directory or symlink, no blocks to process    
      if(numBlocks == -1 || numBlocks == -2) { 
        v.leaveEnclosingElement(); // Blocks
        return;
      }
      
      if(skipBlocks) {
        int fieldsBytes = Long.SIZE * 3;
        if (LayoutVersion.supports(Feature.BLOCK_CHECKSUM, imageVersion)) {
          // For block checksum
          fieldsBytes += Integer.SIZE;
        }
        
        int bytesToSkip = ((fieldsBytes /* fields */) / 8 /*bits*/) * numBlocks;
        if(in.skipBytes(bytesToSkip) != bytesToSkip)
          throw new IOException("Error skipping over blocks");
        
      } else {
        for(int j = 0; j < numBlocks; j++) {
          v.visitEnclosingElement(ImageElement.BLOCK);
          v.visit(ImageElement.BLOCK_ID, in.readLong());
          v.visit(ImageElement.NUM_BYTES, in.readLong());
          v.visit(ImageElement.GENERATION_STAMP, in.readLong());
          if (LayoutVersion.supports(Feature.BLOCK_CHECKSUM, imageVersion)) {
            v.visit(ImageElement.BLOCK_CHECKSUM, in.readInt());
          }
          v.leaveEnclosingElement(); // Block
        }
      }
      v.leaveEnclosingElement(); // Blocks
    }
docs: Process the blocks section of the fsimage.
  
  @param in Datastream to process
  @param v Visitor to walk over inodes
  @param skipBlocks Walk over each block?