return new byte[] {(byte)p, (byte)p};
}
public void testAll() {
PartiallyReceivedBlock prb = new PartiallyReceivedBlock(2, 2);
prb.addPacket(0, new Buffer(makePacket(1)));
LinkedList pr = prb.addListener(new PartiallyReceivedBlock.PacketReceivedListener() {
public void packetReceived(int packetNo) {
System.out.println("Received packet "+packetNo);
}
public void receiveAborted(int reason, String description) {
System.out.println("Receive aborted - "+reason+" "+description);
}
});
prb.addPacket(1, new Buffer(makePacket(2)));
byte[] block = prb.getBlock();
for (int x=0; x<block.length; x++) {
System.out.print(block[x]);
}
System.out.println();