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

Method ReadFloat32Array

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

Source from the content-addressed store, hash-verified

1429 }
1430
1431 private static float[] ReadFloat32Array(ReadContext context)
1432 {
1433 int byteSize = checked((int)context.Reader.ReadVarUInt32());
1434 if ((byteSize & 3) != 0)
1435 {
1436 throw new InvalidDataException("float32 array byte size mismatch");
1437 }
1438
1439 context.Reader.CheckBound(byteSize);
1440 float[] values = new float[byteSize / 4];
1441 for (int i = 0; i < values.Length; i++)
1442 {
1443 values[i] = context.Reader.ReadFloat32();
1444 }
1445
1446 return values;
1447 }
1448
1449 private static double[] ReadFloat64Array(ReadContext context)
1450 {

Callers

nothing calls this directly

Calls 3

ReadVarUInt32Method · 0.80
CheckBoundMethod · 0.80
ReadFloat32Method · 0.45

Tested by

no test coverage detected