flatbuffers/tests/MyGame
bigjt 1a7495a6dd
[C#] Add GetBytes methods for fixed arrays (#8633)
* [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>
2026-02-04 23:13:32 +00:00
..
Example [C#] Add GetBytes methods for fixed arrays (#8633) 2026-02-04 23:13:32 +00:00
Example2 FlatBuffers Version 25.12.19 (#8871) 2025-12-19 15:06:07 -08:00
OtherNameSpace FlatBuffers Version 25.12.19 (#8871) 2025-12-19 15:06:07 -08:00
__init__.py
InParentNamespace.cs FlatBuffers Version 25.12.19 (#8871) 2025-12-19 15:06:07 -08:00
InParentNamespace.go
InParentNamespace.java FlatBuffers Version 25.12.19 (#8871) 2025-12-19 15:06:07 -08:00
InParentNamespace.kt FlatBuffers Version 25.12.19 (#8871) 2025-12-19 15:06:07 -08:00
InParentNamespace.lua FlatBuffers Version 25.12.19 (#8871) 2025-12-19 15:06:07 -08:00
InParentNamespace.nim FlatBuffers Version 25.12.19 (#8871) 2025-12-19 15:06:07 -08:00
InParentNamespace.php
InParentNamespace.py
InParentNamespaceT.java
MonsterExtra.cs FlatBuffers Version 25.12.19 (#8871) 2025-12-19 15:06:07 -08:00
MonsterExtra.java FlatBuffers Version 25.12.19 (#8871) 2025-12-19 15:06:07 -08:00
MonsterExtra.kt FlatBuffers Version 25.12.19 (#8871) 2025-12-19 15:06:07 -08:00
MonsterExtra.py [Python] Improve python API (#8781) 2026-01-21 01:01:20 +00:00
MonsterExtra.pyi [Python] Improve python API (#8781) 2026-01-21 01:01:20 +00:00
MonsterExtraT.java