Class Message


  • class Message
    extends Object
    Used to queue outgoing connections sendMessage() should be used to translate them to wire format.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      (package private) static byte ALLOWED_FAST  
      (package private) int begin  
      (package private) static byte BITFIELD  
      (package private) static byte CANCEL  
      (package private) static byte CHOKE  
      (package private) byte[] data  
      (package private) static byte EXTENSION  
      (package private) static byte HASH_REJECT  
      (package private) static byte HASH_REQUEST  
      (package private) static byte HASHES  
      (package private) static byte HAVE  
      (package private) static byte HAVE_ALL  
      (package private) static byte HAVE_NONE  
      (package private) static byte INTERESTED  
      (package private) static byte KEEP_ALIVE  
      (package private) int len  
      (package private) int length  
      (package private) int off  
      (package private) int piece  
      (package private) static byte PIECE  
      (package private) static byte PORT  
      (package private) static byte REJECT  
      (package private) static byte REQUEST  
      (package private) static byte SUGGEST  
      (package private) byte type  
      (package private) static byte UNCHOKE  
      (package private) static byte UNINTERESTED  
    • Constructor Summary

      Constructors 
      Constructor Description
      Message​(byte type)
      For types KEEP_ALIVE, CHOKE, UNCHOKE, INTERESTED, UNINTERESTED, HAVE_ALL, HAVE_NONE
      Message​(byte[] data)
      For type BITFIELD
      Message​(byte type, int piece)
      For types HAVE, PORT, SUGGEST, ALLOWED_FAST
      Message​(byte type, int piece, int begin, int length)
      For types REQUEST, REJECT, CANCEL
      Message​(int id, byte[] data)
      For type EXTENSION
      Message​(int piece, int begin, int length, DataLoader loader)
      For type PIECE with deferred data