Module id.ICE

Interface MessageScanner

All Known Implementing Classes:
DelimiterMessageScanner, FixedLengthMessageScanner, NewLineMessageScanner, VarLengthMessageScanner
Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public interface MessageScanner
Message scanner allows message server to find where one message ends and another begins.

It is used by ICE server to perform fragmentation of messages in the sequence of bytes.

The implementation of this iface depends on the format of the messages being used. Most common implementations which cover variety of message formats already provided so try to check them before implementing your own.

  • Method Summary

    Modifier and Type
    Method
    Description
    int
     
  • Method Details

    • scan

      int scan(ByteBuffer buf)
      Returns:
      message end position or -1 if message is not complete or not found in the buffer yet. If last byte of the message found on position n then the message end position will be considered as n + 1.