You have a stream of data encoded in some format. You want to also specify information about the data (metadata) and encode that information in the data stream somehow.
Therefore: define a special data element in the stream -- an "escape" -- that tells the reader to enter a mode in which it interprets embedded metadata.
The format of the meta data must be defined so that the reader knows when to stop processing metadata and switch back to reading the base data format.
You will need to define a special sequence of elements to represent the escape element itself in the data stream.
Examples An old, old pattern. This is so widely used it's usually not even seen as a pattern. Examples include: