Examples of MessageException


Examples of com.aelitis.azureus.core.peermanager.messaging.MessageException

  }
 
 
  public Message deserialize( DirectByteBuffer data, byte version ) throws MessageException {
    if( data == null ) {
      throw new MessageException( "[" +getID() +"] decode error: data == null" );
    }
   
    if( data.remaining( DirectByteBuffer.SS_MSG ) != 4 ) {
      throw new MessageException( "[" +getID() "] decode error: payload.remaining[" +data.remaining( DirectByteBuffer.SS_MSG )+ "] != 12" );
    }
   
    int num = data.getInt( DirectByteBuffer.SS_MSG );
    if( num < 0 ) {
      throw new MessageException( "[" +getID() + "] decode error: num < 0" );
    }
   
    data.returnToPool();
   
    return new BTAllowedFast( num, version );
View Full Code Here

Examples of com.aelitis.azureus.core.peermanager.messaging.MessageException

    this.port = port;
  }

  public Message deserialize(DirectByteBuffer data, byte version) throws MessageException {
    if (data == null)
      throw new MessageException("[" +getID() + "] decode error: data == null");
      if (data.remaining(DirectByteBuffer.SS_MSG) != 2)
          throw new MessageException("[" +getID() + "] decode error: payload.remaining[" +data.remaining( DirectByteBuffer.SS_MSG )+ "] != 2");
      short s_port = data.getShort(DirectByteBuffer.SS_MSG);
      data.returnToPool();
      return new BTDHTPort(0xFFFF & s_port);
  }
View Full Code Here

Examples of com.aelitis.azureus.core.peermanager.messaging.MessageException

 
  public DirectByteBuffer[] getData() {  return new DirectByteBuffer[]{}}

  public Message deserialize( DirectByteBuffer data, byte version ) throws MessageException {  
    if( data != null && data.hasRemaining( DirectByteBuffer.SS_MSG ) ) {
      throw new MessageException( "[" +getID() +"] decode error: payload not empty" );
    }
   
    if( data != null data.returnToPool();
   
    return new BTKeepAlive(version);
View Full Code Here

Examples of com.aelitis.azureus.core.peermanager.messaging.MessageException

      this.version = version;
    }

  public Message deserialize(DirectByteBuffer data, byte version) throws MessageException {
    if (data == null) {
      throw new MessageException( "[" +getID() + "] decode error: data == null");
    }
    if (data.remaining(DirectByteBuffer.SS_MSG ) < 1) {
      throw new MessageException( "[" +getID() + "] decode error: less than 1 byte in payload");
    }
   
    // Try decoding the data now.
    Map res_data_dict = MessagingUtil.convertBencodedByteStreamToPayload(data, 1, getID());
   
View Full Code Here

Examples of com.aelitis.azureus.core.peermanager.messaging.MessageException

 
  public DirectByteBuffer[] getData() {  return new DirectByteBuffer[] {}}

  public Message deserialize( DirectByteBuffer data, byte version ) throws MessageException {   
    if( data != null && data.hasRemaining( DirectByteBuffer.SS_MSG ) ) {
      throw new MessageException( "[" +getID() +"] decode error: payload not empty" );
    }
   
    if( data != null data.returnToPool();
   
    return new BTUnchoke( version );
View Full Code Here

Examples of com.aelitis.azureus.core.peermanager.messaging.MessageException

       
        if ( message_id != null ){
        return MessageManager.getSingleton().createMessage( message_id, ref_buff, (byte)1);
        }
          System.out.println( "Unknown LTEP message id [" +id+ "]" );
          throw new MessageException( "Unknown LTEP message id [" +id+ "]" );
      }
    }
  }
View Full Code Here

Examples of com.aelitis.azureus.core.peermanager.messaging.MessageException

    this.extension_id = extension_id;
  }

  // This class should not be used for deserialisation!
  public Message deserialize(DirectByteBuffer data, byte version) throws MessageException {
    throw new MessageException("BTLTMessage cannot be used for message deserialization!");
  }
View Full Code Here

Examples of com.aelitis.azureus.core.peermanager.messaging.MessageException

  public static Message createAZMessage( DirectByteBuffer stream_payload ) throws MessageException {
    int id_length = stream_payload.getInt( bss );

    if( id_length < 1 || id_length > 1024 || id_length > stream_payload.remaining( bss ) - 1 ) {
      byte bt_id = stream_payload.get( (byte)0, 0 );
      throw new MessageException( "invalid AZ id length given: " +id_length+ ", stream_payload.remaining(): " +stream_payload.remaining( bss )+ ", BT id?=" +bt_id );
    }
   
    byte[] id_bytes = new byte[ id_length ];
   
    stream_payload.get( bss, id_bytes );
View Full Code Here

Examples of com.aelitis.azureus.core.peermanager.messaging.MessageException

  }
 
 
  public Message deserialize( DirectByteBuffer data, byte version ) throws MessageException {
    if( data == null ) {
      throw new MessageException( "[" +getID() +"] decode error: data == null" );
    }
   
    if( data.remaining( DirectByteBuffer.SS_MSG ) != 12 ) {
      throw new MessageException( "[" +getID() "] decode error: payload.remaining[" +data.remaining( DirectByteBuffer.SS_MSG )+ "] != 12" );
    }
   
    int num = data.getInt( DirectByteBuffer.SS_MSG );
    if( num < 0 ) {
      throw new MessageException( "[" +getID() + "] decode error: num < 0" );
    }
   
    int offset = data.getInt( DirectByteBuffer.SS_MSG );
    if( offset < 0 ) {
      throw new MessageException( "[" +getID()+ "] decode error: offset < 0" );
    }
   
    int length = data.getInt( DirectByteBuffer.SS_MSG );
    if( length < 0 ) {
      throw new MessageException( "[" +getID() + "] decode error: lngth < 0" );
    }
   
    data.returnToPool();
   
    return new BTCancel( num, offset, length, version );
View Full Code Here

Examples of com.aelitis.azureus.core.peermanager.messaging.MessageException

  }
 
 
  public Message deserialize( DirectByteBuffer data, byte version ) throws MessageException {   
    if( data == null ) {
      throw new MessageException( "[" +getID() + "] decode error: data == null" );
    }
   
    if( data.remaining( DirectByteBuffer.SS_MSG ) != 4 ) {
      throw new MessageException( "[" +getID() + "] decode error: payload.remaining[" +data.remaining( DirectByteBuffer.SS_MSG )+ "] != 4" );
    }
   
    int number = data.getInt( DirectByteBuffer.SS_MSG );
   
    if( number < 0 ) {
      throw new MessageException( "[" +getID() + "] decode error: number < 0" );
    }
   
    data.returnToPool();
   
    return new BTHave( number, version );
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.