-
Interface Summary
Interface |
Description |
RecordParser |
A helper class which allows you to easily parse protocols which are delimited by a sequence of bytes, or fixed
size records.
|
Package io.vertx.core.parsetools Description
== Record Parser
The record parser allows you to easily parse protocols which are delimited by a sequence of bytes, or fixed
size records. It transforms an sequence of input buffer to a sequence of buffer structured as configured (either
fixed size or separated records).
For example, if you have a simple ASCII text protocol delimited by '\n' and the input is the following:
[source]
----
buffer1:HELLO\nHOW ARE Y
buffer2:OU?\nI AM
buffer3: DOING OK
buffer4:\n
----
The record parser would produce
[source]
----
buffer1:HELLO
buffer2:HOW ARE YOU?
buffer3:I AM DOING OK
----
Let's see the associated code:
[source, $lang]
----
RecordParserExamples.example1()
----
You can also produce fixed sized chunks as follows:
[source, $lang]
----
RecordParserExamples.example2()
----
For more details, check out the
RecordParser
class.