Class Block
- java.lang.Object
-
- org.johnnei.javatorrent.torrent.files.Block
-
public final class Block extends Object
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static BlockcopyWithStatus(Block original, BlockStatus newStatus)intgetIndex()Gets the index of this block within the owningPieceintgetSize()Gets the amount of bytes expected for this block.BlockStatusgetStatus()Gets the current status of this block.voidsetStatus(BlockStatus status)Updates the status of the block.StringtoString()
-
-
-
Constructor Detail
-
Block
public Block(int index, int size)Creates a new block which is part of aPiece.- Parameters:
index- The index within the owning piece.size- The size in bytes of this block.
-
-
Method Detail
-
copyWithStatus
public static Block copyWithStatus(Block original, BlockStatus newStatus)
-
setStatus
public void setStatus(BlockStatus status)
Updates the status of the block.- Parameters:
status- The new status of this block.
-
getStatus
public BlockStatus getStatus()
Gets the current status of this block.- Returns:
- The status of this block.
-
getSize
public int getSize()
Gets the amount of bytes expected for this block.- Returns:
- The amount of bytes for this block.
-
getIndex
public int getIndex()
Gets the index of this block within the owningPiece- Returns:
- The index of this block.
-
-