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:
Kevin Fort
2019-09-10 19:07:46 -05:00
committed by Wouter van Oortmerssen
parent b5560fcd52
commit 2706381eef
8 changed files with 38 additions and 24 deletions

View File

@@ -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