6 ms·
For literal binary data you need to store the length information separately. Netstrings are one option for ephemeral streams. But they are a bad tradeoff for p
by jstimpfle 10y ago
For literal binary data you need to store the length information separately.
Netstrings are one option for ephemeral streams. But they are a bad tradeoff for persistent information: you have to read from the beginning of the stream until you find the relevant information. And a single corrupted byte destroys all the information after it.
Better options for persistent data are (pointer+length)s or memory-pools + ranges.