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

Method ReadInt16Array

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

Source from the content-addressed store, hash-verified

1321 }
1322
1323 private static short[] ReadInt16Array(ReadContext context)
1324 {
1325 int byteSize = checked((int)context.Reader.ReadVarUInt32());
1326 if ((byteSize & 1) != 0)
1327 {
1328 throw new InvalidDataException("int16 array byte size mismatch");
1329 }
1330
1331 context.Reader.CheckBound(byteSize);
1332 short[] values = new short[byteSize / 2];
1333 for (int i = 0; i < values.Length; i++)
1334 {
1335 values[i] = context.Reader.ReadInt16();
1336 }
1337
1338 return values;
1339 }
1340
1341 private static int[] ReadInt32Array(ReadContext context)
1342 {

Callers

nothing calls this directly

Calls 3

ReadVarUInt32Method · 0.80
CheckBoundMethod · 0.80
ReadInt16Method · 0.45

Tested by

no test coverage detected