Package org.johnnei.javatorrent.disk
Class DiskJobReadBlock
- java.lang.Object
-
- org.johnnei.javatorrent.disk.DiskJobReadBlock
-
-
Constructor Summary
Constructors Constructor Description DiskJobReadBlock(Piece piece, int offset, int length, Consumer<DiskJobReadBlock> callback)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description byte[]getBlockData()The read data from the pieceintgetOffset()Gets the offset at which the data started reading.PiecegetPiece()The piece from which data was read.intgetPriority()The priority of this jobvoidprocess()Processes the disk jobStringtoString()
-
-
-
Constructor Detail
-
DiskJobReadBlock
public DiskJobReadBlock(Piece piece, int offset, int length, Consumer<DiskJobReadBlock> callback)
-
-
Method Detail
-
process
public void process() throws IOExceptionProcesses the disk job- Specified by:
processin interfaceIDiskJob- Throws:
IOException
-
getPriority
public int getPriority()
The priority of this job- Specified by:
getPriorityin interfaceIDiskJob- Returns:
- The priority
-
getBlockData
public byte[] getBlockData()
The read data from the piece- Returns:
- The read data
- See Also:
getPiece()
-
getPiece
public Piece getPiece()
The piece from which data was read.- Returns:
- The piece from which data was read.
-
getOffset
public int getOffset()
Gets the offset at which the data started reading.- Returns:
- The data offset
-
-