reassemble

fun reassemble(data: ByteArray): Pdu?

This method consumes the given data. If the data were segmented, they are buffered until the last segment is received. This method returns the message and its type when the last segment (or the only one) has been received, otherwise it returns null.

The packets must be delivered in order. If a new message is received while the previous one is still reassembled, the old one will be disregarded. Invalid messages are disregarded.

Return

The message and its type, or null, if more data are expected.

Parameters

data

The data received.