FileDocCategorySizeDatePackage
PRUDPPacketReplyScrape2.javaAPI DocAzureus 3.0.3.42920Thu Jan 05 05:43:26 GMT 2006org.gudy.azureus2.core3.tracker.protocol.udp

PRUDPPacketReplyScrape2

public class PRUDPPacketReplyScrape2 extends com.aelitis.net.udp.uc.PRUDPPacketReply
author
parg

Fields Summary
protected static final int
BYTES_PER_ENTRY
protected int[]
complete
protected int[]
incomplete
protected int[]
downloaded
Constructors Summary
public PRUDPPacketReplyScrape2(int trans_id)

	
	
	
					 
	
		super( PRUDPPacketTracker.ACT_REPLY_SCRAPE, trans_id );
	
protected PRUDPPacketReplyScrape2(DataInputStream is, int trans_id)

		super( PRUDPPacketTracker.ACT_REPLY_SCRAPE, trans_id );
		
		// interval = is.readInt();
		
		complete	= new int[is.available()/BYTES_PER_ENTRY];
		incomplete	= new int[complete.length];
		downloaded	= new int[complete.length];
		
		for (int i=0;i<complete.length;i++){
			
			complete[i] 	= is.readInt();
			downloaded[i] 	= is.readInt();
			incomplete[i] 	= is.readInt();
		}
	
Methods Summary
public int[]getComplete()

		return( complete );
	
public int[]getDownloaded()

		return( downloaded );
	
public int[]getIncomplete()

		return( incomplete );
	
public java.lang.StringgetString()

		String	data = "";
		
		for (int i=0;i<complete.length;i++){
			data += (i==0?"":",") + complete[i] + "/" + incomplete[i] + "/" + downloaded[i];
		}
		return( super.getString()+"[entries="+complete.length+"=" + data +"]");
	
public voidserialise(java.io.DataOutputStream os)

		super.serialise(os);
		
		// os.writeInt( interval );
		
		if ( complete != null ){
			
			for (int i=0;i<complete.length;i++){
				
				os.writeInt( complete[i] );
				os.writeInt( downloaded[i] );
				os.writeInt( incomplete[i] );
			}
		}
	
public voidsetDetails(int[] _complete, int[] _downloaded, int[] _incomplete)

		complete		= _complete;
		downloaded		= _downloaded;
		incomplete		= _incomplete;