def createBlockinfoByPieceAndBlockIndex(pieceIndex, peersWithPiece, blockIndex)
      # If this is the very last block, then it might be smaller than the rest.
      blockSize = @blockSize
      blockSize = @lastBlockLength if blockIndex == @numBlocks-1
      offsetWithinPiece = (blockIndex % @blocksPerPiece)*@blockSize
      BlockInfo.new(pieceIndex, offsetWithinPiece, blockSize, peersWithPiece, blockIndex)
    end
def createBlockinfoByPieceAndBlockIndex(pieceIndex, peersWithPiece, blockIndex)
      # If this is the very last block, then it might be smaller than the rest.
      blockSize = @blockSize
      blockSize = @lastBlockLength if blockIndex == @numBlocks-1
      offsetWithinPiece = (blockIndex % @blocksPerPiece)*@blockSize
      BlockInfo.new(pieceIndex, offsetWithinPiece, blockSize, peersWithPiece, blockIndex)
    end
Create a new BlockInfo object using the specified information.