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

Method ReadUInt16Array

csharp/src/Fory/TypeResolver.cs:1377–1393  ·  view source on GitHub ↗
(ReadContext context)

Source from the content-addressed store, hash-verified

1375 }
1376
1377 private static ushort[] ReadUInt16Array(ReadContext context)
1378 {
1379 int byteSize = checked((int)context.Reader.ReadVarUInt32());
1380 if ((byteSize & 1) != 0)
1381 {
1382 throw new InvalidDataException("uint16 array byte size mismatch");
1383 }
1384
1385 context.Reader.CheckBound(byteSize);
1386 ushort[] values = new ushort[byteSize / 2];
1387 for (int i = 0; i < values.Length; i++)
1388 {
1389 values[i] = context.Reader.ReadUInt16();
1390 }
1391
1392 return values;
1393 }
1394
1395 private static uint[] ReadUInt32Array(ReadContext context)
1396 {

Callers

nothing calls this directly

Calls 3

ReadVarUInt32Method · 0.80
CheckBoundMethod · 0.80
ReadUInt16Method · 0.80

Tested by

no test coverage detected