Package com.aelitis.azureus.core.peermanager.messaging

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: length < 0" );
    }
   
    data.returnToPool();
   
    return new BTRequest( num, offset, length, version );
View Full Code Here


    DirectByteBuffer   data,
    byte        version )
 
    throws MessageException
  {
    throw( new MessageException( "not supported" ));
  }
View Full Code Here

 
  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 [" +data.remaining(DirectByteBuffer.SS_MSG)+ "]" );
    }
   
    if( data != null data.returnToPool();
   
    return new BTHaveAll(version);
View Full Code Here

 
  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 [" +data.remaining(DirectByteBuffer.SS_MSG)+ "]" );
    }
   
    if( data != null data.returnToPool();
   
    return new BTHaveNone(version);
View Full Code Here

TOP

Related Classes of com.aelitis.azureus.core.peermanager.messaging.MessageException

Copyright © 2018 www.massapicom. 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.