Class MessageBlock

    • Constructor Detail

      • MessageBlock

        public MessageBlock()
      • MessageBlock

        public MessageBlock​(int index,
                            int offset,
                            byte[] data)
    • Method Detail

      • write

        public void write​(OutStream outStream)
        Description copied from interface: IMessage
        Writes the message to the output stream
        Specified by:
        write in interface IMessage
        Parameters:
        outStream - The buffered outputstream to write the message on
      • read

        public void read​(InStream inStream)
        Description copied from interface: IMessage
        Read a message from the inputStream
        Specified by:
        read in interface IMessage
        Parameters:
        inStream - The buffered inputstream to read the message from
      • process

        public void process​(Peer peer)
        Description copied from interface: IMessage
        Process the message
        Specified by:
        process in interface IMessage
        Parameters:
        peer - The client which should process this message
      • getLength

        public int getLength()
        Description copied from interface: IMessage
        The length of the message (only needed on writing)
        The length should include the byte for the message id
        Specified by:
        getLength in interface IMessage
        Returns:
        integer
      • getId

        public int getId()
        Description copied from interface: IMessage
        The id of this message
        Specified by:
        getId in interface IMessage
        Returns:
        id