class Request extends Object
This class should be used only by PeerState, PeerConnectionIn, and PeerConnectionOut.
| Modifier and Type | Field and Description |
|---|---|
(package private) int | lenLen |
(package private) int | offOff |
(package private) long | sendTimeSend time |
| Constructor and Description |
|---|
Request(PartialPiece piece,
int off)Dummy Request for PeerState.returnPartialPieces(). |
Request(PartialPiece piece,
int off,
int len)Creates a new Request. |
| Modifier and Type | Method and Description |
|---|---|
boolean | equals(Object o)Two requests are equal if they share the same piece, offset, and length |
PartialPiece | getPartialPiece()The PartialPiece this Request is for |
int | getPiece()The piece number this Request is for |
int | hashCode()Hash based on piece number, offset, and length |
void | read(DataInputStream din,
BandwidthListener bwl)Read from stream |
String | toString() |
Request(PartialPiece piece, int off)
piece - Piece number requested.off - the offset in the array.Request(PartialPiece piece, int off, int len)
piece - Piece number requested.off - the offset in the array.len - the number of bytes requested.public boolean equals(Object o)
public PartialPiece getPartialPiece()
public int getPiece()
public int hashCode()
public void read(DataInputStream din, BandwidthListener bwl) throws IOException
IOException