mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-16 09:12:22 +00:00
Add element size parameter to __vector_as_arraysegment [c#] (#5512)
* Add element size parameter to __vector_as_arraysegment Add element size parameter to __vector_as_arraysegment fixing issue where VectorAsBytes returns incorrect size span for multibyte element types. * Update codegen Update codegen and Table to return typed span. * update test files update test files
This commit is contained in:
committed by
Wouter van Oortmerssen
parent
b5560fcd52
commit
2706381eef
@@ -20,7 +20,7 @@ public struct Stat : IFlatbufferObject
|
||||
|
||||
public string Id { get { int o = __p.__offset(4); return o != 0 ? __p.__string(o + __p.bb_pos) : null; } }
|
||||
#if ENABLE_SPAN_T
|
||||
public Span<byte> GetIdBytes() { return __p.__vector_as_span(4); }
|
||||
public Span<byte> GetIdBytes() { return __p.__vector_as_span<byte>(4, 1); }
|
||||
#else
|
||||
public ArraySegment<byte>? GetIdBytes() { return __p.__vector_as_arraysegment(4); }
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user