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

Method ReadData

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

Source from the content-addressed store, hash-verified

359 }
360
361 public override BFloat16[] ReadData(ReadContext context)
362 {
363 int byteSize = checked((int)context.Reader.ReadVarUInt32());
364 if ((byteSize & 1) != 0)
365 {
366 throw new InvalidDataException("bfloat16 array byte size mismatch");
367 }
368
369 context.Reader.CheckBound(byteSize);
370 BFloat16[] values = new BFloat16[byteSize / 2];
371 for (int i = 0; i < values.Length; i++)
372 {
373 values[i] = BFloat16.FromBits(context.Reader.ReadUInt16());
374 }
375
376 return values;
377 }
378}
379
380internal sealed class Float32ArraySerializer : Serializer<float[]>

Callers

nothing calls this directly

Calls 4

ReadVarUInt32Method · 0.80
CheckBoundMethod · 0.80
FromBitsMethod · 0.80
ReadUInt16Method · 0.80

Tested by

no test coverage detected