org.vertx.scala.core.parsetools
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
string to convert
The byte[] form of the string
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.
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.
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.
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:
Then the output would be: 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