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

Method WriteData

csharp/src/Fory/PrimitiveArraySerializers.cs:350–359  ·  view source on GitHub ↗
(WriteContext context, in BFloat16[] value, bool hasGenerics)

Source from the content-addressed store, hash-verified

348 public override BFloat16[] DefaultValue => null!;
349
350 public override void WriteData(WriteContext context, in BFloat16[] value, bool hasGenerics)
351 {
352 _ = hasGenerics;
353 BFloat16[] safe = value ?? [];
354 context.Writer.WriteVarUInt32((uint)(safe.Length * 2));
355 for (int i = 0; i < safe.Length; i++)
356 {
357 context.Writer.WriteUInt16(safe[i].ToBits());
358 }
359 }
360
361 public override BFloat16[] ReadData(ReadContext context)
362 {

Callers

nothing calls this directly

Calls 3

WriteVarUInt32Method · 0.80
WriteUInt16Method · 0.80
ToBitsMethod · 0.80

Tested by

no test coverage detected