org.vertx.scala.core.parsetools

RecordParser

object RecordParser

A helper class which allows you to easily parse protocols which are delimited by a sequence of bytes, or fixed size records.

Instances of this class take as input org.vertx.scala.core.buffer.Buffer instances containing raw bytes, and output records.

For example, if I had a simple ASCII text protocol delimited by '\n' and the input was the following:

buffer1:HELLO\nHOW ARE Y
buffer2:OU?\nI AM
buffer3: DOING OK
buffer4:\n
Then the output would be:

buffer1:HELLO
buffer2:HOW ARE YOU?
buffer3:I AM DOING OK
Instances of this class can be changed between delimited mode and fixed size record mode on the fly as individual records are read, this allows you to parse protocols where, for example, the first 5 records might all be fixed size (of potentially different sizes), followed by some delimited records, followed by more fixed size records.

Instances of this class can't currently be used for protocols where the text is encoded with something other than a 1-1 byte-char mapping. TODO extend this class to cope with arbitrary character encodings

Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. RecordParser
  2. AnyRef
  3. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Value Members

  1. final def !=(arg0: Any): Boolean

    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  5. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  6. final def eq(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  7. def equals(arg0: Any): Boolean

    Definition Classes
    AnyRef → Any
  8. def finalize(): Unit

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  9. final def getClass(): Class[_]

    Definition Classes
    AnyRef → Any
  10. def hashCode(): Int

    Definition Classes
    AnyRef → Any
  11. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  12. def latin1StringToBytes(str: String): Array[Byte]

    Helper method to convert a latin-1 String to an array of bytes for use as a delimiter Please do not use this for non latin-1 characters

    Helper method to convert a latin-1 String to an array of bytes for use as a delimiter Please do not use this for non latin-1 characters

    str

    string to convert

    returns

    The byte[] form of the string

  13. final def ne(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  14. def newDelimited(delim: Array[Byte], handler: (Buffer) ⇒ Unit): RecordParser

    Create a new RecordParser instance, initially in delimited mode, and where the delimiter can be represented by the byte[] delim.

    Create a new RecordParser instance, initially in delimited mode, and where the delimiter can be represented by the byte[] delim.

    output Will receive whole records which have been parsed.

  15. def newDelimited(delim: String, handler: (Buffer) ⇒ Unit): RecordParser

    Create a new RecordParser instance, initially in delimited mode, and where the delimiter can be represented by the String delim endcoded in latin-1 .

    Create a new RecordParser instance, initially in delimited mode, and where the delimiter can be represented by the String delim endcoded in latin-1 . Don't use this if your String contains other than latin-1 characters.

    output Will receive whole records which have been parsed.

  16. def newFixed(size: Int, handler: (Buffer) ⇒ Unit): RecordParser

    Create a new RecordParser instance, initially in fixed size mode, and where the record size is specified by the size parameter.

    Create a new RecordParser instance, initially in fixed size mode, and where the record size is specified by the size parameter.

    output Will receive whole records which have been parsed.

  17. final def notify(): Unit

    Definition Classes
    AnyRef
  18. final def notifyAll(): Unit

    Definition Classes
    AnyRef
  19. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  20. def toString(): String

    Definition Classes
    AnyRef → Any
  21. final def wait(): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  22. final def wait(arg0: Long, arg1: Int): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  23. final def wait(arg0: Long): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from AnyRef

Inherited from Any

Ungrouped