Interface IMessage

    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      int getId()
      The id of this message
      int getLength()
      The length of the message (only needed on writing)
      The length should include the byte for the message id
      void process​(Peer peer)
      Process the message
      void read​(InStream inStream)
      Read a message from the inputStream
      void write​(OutStream outStream)
      Writes the message to the output stream
    • Method Detail

      • write

        void write​(OutStream outStream)
        Writes the message to the output stream
        Parameters:
        outStream - The buffered outputstream to write the message on
      • read

        void read​(InStream inStream)
        Read a message from the inputStream
        Parameters:
        inStream - The buffered inputstream to read the message from
      • process

        void process​(Peer peer)
        Process the message
        Parameters:
        peer - The client which should process this message
      • getLength

        int getLength()
        The length of the message (only needed on writing)
        The length should include the byte for the message id
        Returns:
        integer