Methods Summary |
---|
public Message | deserialize(DirectByteBuffer data, byte version)
Map root = MessagingUtil.convertBencodedByteStreamToPayload( data, 20, getID() );
byte[] hash = (byte[])root.get( "infohash" );
if( hash == null ) throw new MessageException( "hash == null" );
if( hash.length != 20 ) throw new MessageException( "hash.length != 20: " +hash.length );
byte[] reason_raw = (byte[])root.get( "reason" );
if( reason_raw == null ) throw new MessageException( "reason_raw == null" );
String res = new String( reason_raw );
return new AZSessionEnd( hash, res, version );
|
public void | destroy()
if( buffer != null ) buffer.returnToPool();
|
public DirectByteBuffer[] | getData()
if( buffer == null ) {
Map payload_map = new HashMap();
payload_map.put( "infohash", infohash );
payload_map.put( "reason", reason );
buffer = MessagingUtil.convertPayloadToBencodedByteStream( payload_map, DirectByteBuffer.AL_MSG );
}
return new DirectByteBuffer[]{ buffer };
|
public java.lang.String | getDescription()
if( description == null ) {
description = getID()+ " for infohash " +ByteFormatter.nicePrint( infohash, true )+ " because " +reason;
}
return description;
|
public java.lang.String | getEndReason() return reason;
|
public java.lang.String | getFeatureID() throw new RuntimeException( "not implemented" );
|
public int | getFeatureSubID() throw new RuntimeException( "not implemented" );
|
public java.lang.String | getID() return AZMessage.ID_AZ_SESSION_END;
|
public byte[] | getIDBytes() return AZMessage.ID_AZ_SESSION_END_BYTES;
|
public byte[] | getInfoHash() return infohash;
|
public int | getType() return Message.TYPE_PROTOCOL_PAYLOAD;
|
public byte | getVersion() return version;
|