glaze icon indicating copy to clipboard operation
glaze copied to clipboard

Multiple objects in one buffer

Open ChristofferGreen opened this issue 1 year ago • 2 comments

Hi!

When using glz::write_binary_untagged it looks like glaze always overwrites the contents of the input buffer. Is there any way to have the new data appended instead?

Thanks

Br/ Christoffer

ChristofferGreen avatar Apr 14 '24 14:04 ChristofferGreen

Glaze supports NDJSON, and the intention was to add matching support for delineated binary, so that multiple objects occur beside one another in the same buffer. I'll keep this issue active until support has been added. Appending to the buffer in these contexts makes a lot of sense.

stephenberry avatar Apr 15 '24 11:04 stephenberry

Sounds good. Thinking about it a read deserialise function from a buffer possibly containing multiple elements would also need to tell the user how many bytes were read, in case they want to remove those bytes from the vector (or similar).

ChristofferGreen avatar Apr 18 '24 18:04 ChristofferGreen