Class Block


  • public final class Block
    extends Object
    • Constructor Detail

      • Block

        public Block​(int index,
                     int size)
        Creates a new block which is part of a Piece.
        Parameters:
        index - The index within the owning piece.
        size - The size in bytes of this block.
    • Method Detail

      • 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 owning Piece
        Returns:
        The index of this block.