google / flatbuffers

FlatBuffers: Memory Efficient Serialization Library
https://flatbuffers.dev/
Apache License 2.0
22.56k stars 3.19k forks source link

Streaming flatbuffers in java #8240

Closed adparts closed 4 months ago

adparts commented 4 months ago

Using java flatbuffers library to parse messages via an InputStream, a read buffer[] can contain one or more flatbuffer messages,

Is there any way to read two independent flatbuffer objects received from a stream of bytes using java? I don't know how to calculate the offset for the subsequent ones...

Thank you

adparts commented 4 months ago

Solved prepending a 2 byte sequence with the flatbuffer message length in each buffer.