new RecordParser()
A helper class which allows you to easily parse protocols which are delimited by a sequence of bytes, or fixed
size records.
- Source:
Methods
-
delimitedMode(delim)
-
Flip the parser into delimited mode, and where the delimiter can be represented by the delimiter
delim.This method can be called multiple times with different values of delim while data is being parsed.
Parameters:
Name Type Description delimBuffer the new delimiter - Source:
-
fixedSizeMode(size)
-
Flip the parser into fixed size mode, where the record size is specified by
sizein bytes.This method can be called multiple times with different values of size while data is being parsed.
Parameters:
Name Type Description sizenumber the new record size - Source:
-
handle(buffer)
-
This method is called to provide the parser with data.
Parameters:
Name Type Description bufferBuffer a chunk of data - Source:
-
setOutput(output)
-
Parameters:
Name Type Description outputfunction - Source: