C#: Missing FlatBufferBuilder.Add(ArraySegment<T>) overload #7172
Jamie-Jameson
started this conversation in
Ideas
Replies: 1 comment
-
Note that I created a pull request for this: |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi all,
In a very large application, we're trying to optimize our current serialization of image data by migrating to FlatBuffers. However, lots or our data is stored in pooled buffers of arbitrary length, where the data only uses a smaller segment of it. This is exactly what ArraySegment and Span is for.
The current implementation of FlatBufferBuilder (and ByteBuffer) provide only methods for adding arrays (i.e. Add(T[], Put(T[], etc.). When compiling with ENABLE_SPAN_T, overloads with Span are available. However, for various project restrictions this is not an option for us.
I'd like to know why there aren't overloads that take ArraySegment?? This seems to an obvious and straightforward thing to implement. Also given that there are plenty of options to get ArraySegments out of the buffers.
If possible, I would also very willing to provide an implementation and contribute this to the project - although I've no real experience in doing this :). How would I do this?
Many thanks for now and greetings,
Jamie
Beta Was this translation helpful? Give feedback.
All reactions