FileDocCategorySizeDatePackage
BTBitfield.javaAPI DocAzureus 3.0.3.42503Sun Mar 04 21:08:16 GMT 2007com.aelitis.azureus.core.peermanager.messaging.bittorrent

BTBitfield

public class BTBitfield extends Object implements BTMessage
BitTorrent bitfield message.

Fields Summary
private final DirectByteBuffer[]
buffer
private final byte
version
Constructors Summary
public BTBitfield(DirectByteBuffer bitfield, byte _version)

    buffer 	= new DirectByteBuffer[] { bitfield };
    version	= _version;
  
Methods Summary
public com.aelitis.azureus.core.peermanager.messaging.Messagedeserialize(DirectByteBuffer data, byte version)

    
    if( data == null ) {
      throw new MessageException( "[" +getID() +"] decode error: data == null" );
    }
        
    return new BTBitfield( data, version );
  
public voiddestroy()

    if( buffer[0] != null )  buffer[0].returnToPool();
  
public DirectByteBuffergetBitfield()

  return buffer[0];  
public DirectByteBuffer[]getData()

  return buffer;  
public java.lang.StringgetDescription()

  return BTMessage.ID_BT_BITFIELD;  
public java.lang.StringgetFeatureID()

  return BTMessage.BT_FEATURE_ID;  
public intgetFeatureSubID()

  return BTMessage.SUBID_BT_BITFIELD;  
public java.lang.StringgetID()

  return BTMessage.ID_BT_BITFIELD;  
public byte[]getIDBytes()

  return BTMessage.ID_BT_BITFIELD_BYTES;  
public intgetType()

  return Message.TYPE_PROTOCOL_PAYLOAD;  
public bytegetVersion()

 return version;