Class BlockInfo

java.lang.Object
com.frostwire.jlibtorrent.BlockInfo

public final class BlockInfo extends Object
Holds the state of a block in a piece. Who we requested it from and how far along we are at downloading it.
  • Constructor Details

    • BlockInfo

      public BlockInfo(block_info b)
      Parameters:
      b - the native object
  • Method Details

    • swig

      public block_info swig()
      Returns:
      the native object
    • peer

      public TcpEndpoint peer()
      The peer is the ip address of the peer this block was downloaded from.
      Returns:
      the peer tcp endpoint
    • bytesProgress

      public int bytesProgress()
      The number of bytes that have been received for this block.
      Returns:
      the number of bytes received
    • blockSize

      public int blockSize()
      The total number of bytes in this block.
      Returns:
      otal number of bytes
    • state

      public BlockInfo.BlockState state()
      The state this block is in.
      Returns:
      the block's state
    • numPeers

      public int numPeers()
      The number of peers that is currently requesting this block. Typically this is 0 or 1, but at the end of the torrent blocks may be requested by more peers in parallel to speed things up.
      Returns:
      number of peers