public class PartiallyReceivedBlock
extends java.lang.Object
| Modifier and Type | Class and Description |
|---|---|
static interface |
PartiallyReceivedBlock.PacketReceivedListener |
| Modifier and Type | Field and Description |
|---|---|
int |
_packets |
int |
_packetSize |
| Constructor and Description |
|---|
PartiallyReceivedBlock(int packets,
int packetSize) |
PartiallyReceivedBlock(int packets,
int packetSize,
byte[] data) |
| Modifier and Type | Method and Description |
|---|---|
byte[] |
abort(int reason,
java.lang.String description,
boolean cancelledLocally)
Abort the transfer.
|
boolean |
abortedLocally() |
java.util.Deque<java.lang.Integer> |
addListener(PartiallyReceivedBlock.PacketReceivedListener listener) |
void |
addPacket(int position,
Buffer packet) |
boolean |
allReceived() |
boolean |
allReceivedAndNotAborted() |
java.lang.String |
getAbortDescription() |
int |
getAbortReason() |
byte[] |
getBlock() |
int |
getNumPackets() |
Buffer |
getPacket(int x) |
int |
getPacketSize() |
boolean |
isAborted() |
boolean |
isReceived(int packetNo) |
void |
removeListener(PartiallyReceivedBlock.PacketReceivedListener listener) |
public PartiallyReceivedBlock(int packets,
int packetSize,
byte[] data)
public PartiallyReceivedBlock(int packets,
int packetSize)
public java.util.Deque<java.lang.Integer> addListener(PartiallyReceivedBlock.PacketReceivedListener listener) throws AbortedException
AbortedExceptionpublic boolean isReceived(int packetNo)
throws AbortedException
AbortedExceptionpublic int getNumPackets()
throws AbortedException
AbortedExceptionpublic int getPacketSize()
throws AbortedException
AbortedExceptionpublic void addPacket(int position,
Buffer packet)
throws AbortedException
AbortedExceptionpublic boolean allReceivedAndNotAborted()
public boolean allReceived()
throws AbortedException
AbortedExceptionpublic byte[] getBlock()
throws AbortedException
AbortedExceptionpublic Buffer getPacket(int x) throws AbortedException
AbortedExceptionpublic void removeListener(PartiallyReceivedBlock.PacketReceivedListener listener)
public byte[] abort(int reason,
java.lang.String description,
boolean cancelledLocally)
reason - description - cancelledLocally - If true, the transfer was deliberately aborted by *this node*,
not as the result of a timeout.public boolean isAborted()
public int getAbortReason()
public java.lang.String getAbortDescription()
public boolean abortedLocally()