Module id.ICE

Class DelimiterMessageScanner

  • All Implemented Interfaces:
    Direct Known Subclasses:

    public class DelimiterMessageScanner
    extends Object
    implements MessageScanner
    Scanner for messages where each message is represented as a single line ending with some delimiter char (ex. ';'). The delimiter is not considered as part of the message.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int scan​(ByteBuffer buf)  
      • Methods inherited from class Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • DelimiterMessageScanner

        public DelimiterMessageScanner​(byte delim)
        delim - delimiter character (for UTF-8 characters use conversion for example for ';' use (byte)';')
    • Method Detail

      • scan

        public int scan​(ByteBuffer buf)
        Specified by:
        scan in interface MessageScanner
        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.