You are here: Elements > Decoder Script Reference > BYTE_STREAM_FRAMER

BYTE_STREAM_FRAMER

BYTE_STREAM_FRAMER identifies a method that is sort of like a frame recognizer, but it only acts on the data found at the current layer. Because of this, it has some different needs and is implemented as a different type. This method is only invoked if the layer that was just decoded (i.e. the previous layer in the stack) has the PAYLOAD_IS_BYTE_STREAM keyword in it.

BYTE_STREAM_FRAMER is used when the payload of a particular layer is simply a byte stream that the upper layers know nothing about. For instance, imagine a protocol where the payload is always exactly 50 bytes long, and the actual messages are split across as many frames as is needed. If all the payloads are clipped out of the frames and put together, it would resemble the byte stream that comes from a serial port. We would need some type of recognizer to split that byte stream into intelligible frames, but standard frame recognizers work only on data that has not previously been framed by any other method.