Interface MessageStreamDecoder


public interface MessageStreamDecoder
Decodes a message stream into separate messages.
  • Method Details

    • performStreamDecode

      int performStreamDecode(Transport transport, int max_bytes) throws IOException
      Decode message stream from the given transport.
      Parameters:
      transport - to decode from
      max_bytes - to decode/read from the stream
      Returns:
      number of bytes decoded
      Throws:
      IOException - on decoding error
    • removeDecodedMessages

      Message[] removeDecodedMessages()
      Get the messages decoded from the transport, if any, from the last decode op.
      Returns:
      decoded messages, or null if no new complete messages were decoded
    • getProtocolBytesDecoded

      int getProtocolBytesDecoded()
      Get the number of protocol (overhead) bytes decoded from the transport, from the last decode op.
      Returns:
      number of protocol bytes received
    • getDataBytesDecoded

      int getDataBytesDecoded()
      Get the number of (piece) data bytes decoded from the transport, from the last decode op.
      Returns:
      number of data bytes received
    • pauseDecoding

      void pauseDecoding()
      Pause message decoding.
    • resumeDecoding

      void resumeDecoding()
      Resume message decoding.
    • destroy

      ByteBuffer destroy()
      Destroy this decoder, i.e. perform cleanup.
      Returns:
      any bytes already-read and still remaining within the decoder