Package org.klomp.snark
Class Request
- java.lang.Object
-
- org.klomp.snark.Request
-
class Request extends Object
Holds all information needed for a partial piece request. This class should be used only by PeerState, PeerConnectionIn, and PeerConnectionOut.
-
-
Constructor Summary
Constructors Constructor Description Request(PartialPiece piece, int off)
Dummy Request for PeerState.returnPartialPieces().Request(PartialPiece piece, int off, int len)
Creates a new Request.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object o)
PartialPiece
getPartialPiece()
The PartialPiece this Request is forint
getPiece()
The piece number this Request is forint
hashCode()
void
read(DataInputStream din)
String
toString()
-
-
-
Constructor Detail
-
Request
Request(PartialPiece piece, int off, int len)
Creates a new Request.- Parameters:
piece
- Piece number requested.off
- the offset in the array.len
- the number of bytes requested.
-
Request
Request(PartialPiece piece, int off)
Dummy Request for PeerState.returnPartialPieces(). len will be zero.- Parameters:
piece
- Piece number requested.off
- the offset in the array.- Since:
- 0.9.36
-
-
Method Detail
-
read
public void read(DataInputStream din) throws IOException
- Throws:
IOException
- Since:
- 0.9.1
-
getPiece
public int getPiece()
The piece number this Request is for- Since:
- 0.9.1
-
getPartialPiece
public PartialPiece getPartialPiece()
The PartialPiece this Request is for- Since:
- 0.9.1
-
-