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

Method WriteData

go/fory/primitive.go:618–624  ·  view source on GitHub ↗
(ctx *WriteContext, value reflect.Value)

Source from the content-addressed store, hash-verified

616var globalFloat16Serializer = float16Serializer{}
617
618func (s float16Serializer) WriteData(ctx *WriteContext, value reflect.Value) {
619 // Value is effectively uint16 (alias)
620 // We can use WriteUint16, but we check if it is indeed float16 compatible
621 // The value comes from reflection, likely an interface or concrete type
622 // Since Float16 is uint16, value.Uint() works.
623 ctx.buffer.WriteUint16(uint16(value.Uint()))
624}
625
626func (s float16Serializer) Write(ctx *WriteContext, refMode RefMode, writeType bool, hasGenerics bool, value reflect.Value) {
627 if refMode != RefModeNone {

Callers 1

WriteMethod · 0.95

Calls 2

WriteUint16Method · 0.80
uint16Function · 0.50

Tested by

no test coverage detected