MCPcopy Create free account
hub / github.com/apache/fory / ReadData

Method ReadData

csharp/src/Fory/PrimitiveArraySerializers.cs:213–229  ·  view source on GitHub ↗
(ReadContext context)

Source from the content-addressed store, hash-verified

211 }
212
213 public override ushort[] ReadData(ReadContext context)
214 {
215 int byteSize = checked((int)context.Reader.ReadVarUInt32());
216 if ((byteSize & 1) != 0)
217 {
218 throw new InvalidDataException("uint16 array byte size mismatch");
219 }
220
221 context.Reader.CheckBound(byteSize);
222 ushort[] values = new ushort[byteSize / 2];
223 for (int i = 0; i < values.Length; i++)
224 {
225 values[i] = context.Reader.ReadUInt16();
226 }
227
228 return values;
229 }
230}
231
232internal sealed class UInt32ArraySerializer : Serializer<uint[]>

Callers

nothing calls this directly

Calls 3

ReadVarUInt32Method · 0.80
CheckBoundMethod · 0.80
ReadUInt16Method · 0.80

Tested by

no test coverage detected