mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-02 20:15:34 +00:00
* [C#] Add GetBytes methods for fixed arrays I wanted to direct access to fixed array bytes. I made some changes to the idl generator to create GetBytes functions following the same naming conventions used for vectors of scalar types. There was not a 'Length' field present to bound the existing index accessor so I added that too. + Add generic GetBytes for fixed length arrays of scalar types + Implement conditional compilation for ENABLE_SPAN_T: - ENABLE_SPAN_T: Returns `Span<T>` using `MemoryMarshal.Cast<byte, T>()` as needed. - Else: Returns `ArraySegment<byte>?` for raw byte access + Added tests reusing arrays_test.fbs definitions + Added const int Length field to support existing index based accessors * [C#] Sync generated code for after adding GetBytes methods for fixed arrays --------- Co-authored-by: Björn Harrtell <bjornharrtell@users.noreply.github.com>
5.1 KiB
5.1 KiB