Methods Summary |
---|
public com.aelitis.azureus.core.peermanager.messaging.Message | deserialize(org.gudy.azureus2.core3.util.DirectByteBuffer data, byte version)
Map payload = MessagingUtil.convertBencodedByteStreamToPayload( data, 1, getID() );
List l = (List)payload.get( "pieces");
int[] pieces = new int[l.size()];
for (int i=0;i<pieces.length;i++){
pieces[i] = ((Long)l.get(i)).intValue();
}
AZHave message = new AZHave( pieces, version );
return( message );
|
public void | destroy()
if ( buffer != null ){
buffer.returnToPool();
}
|
public org.gudy.azureus2.core3.util.DirectByteBuffer[] | getData()
if ( buffer == null ){
Map map = new HashMap();
List l = new ArrayList( piece_numbers.length );
for (int i=0;i<piece_numbers.length;i++){
l.add( new Long( piece_numbers[i] ));
}
map.put( "pieces", l );
buffer = MessagingUtil.convertPayloadToBencodedByteStream( map, DirectByteBuffer.AL_MSG );
}
return new DirectByteBuffer[]{ buffer };
|
public java.lang.String | getDescription()
StringBuffer str = new StringBuffer(piece_numbers.length*10);
for (int i=0;i<piece_numbers.length;i++){
if ( i > 0 ){
str.append(",");
}
str.append( piece_numbers[i] );
}
return( getID() + " " + str );
|
public java.lang.String | getFeatureID()
return( AZMessage.AZ_FEATURE_ID );
|
public int | getFeatureSubID()
return( AZMessage.SUBID_ID_AZ_HAVE );
|
public java.lang.String | getID()
return( AZMessage.ID_AZ_HAVE );
|
public byte[] | getIDBytes()
return( AZMessage.ID_AZ_HAVE_BYTES );
|
public int[] | getPieceNumbers()
return( piece_numbers );
|
public int | getType()
return( Message.TYPE_PROTOCOL_PAYLOAD );
|
public byte | getVersion() return version;
|