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

Function WriteByteSlice

go/fory/slice_primitive.go:709–714  ·  view source on GitHub ↗

============================================================================ Exported helper functions for primitive slice serialization (ARRAY protocol) These functions write: size_bytes + binary_data They are used by struct serializers and generated code ===========================================

(buf *ByteBuffer, value []byte)

Source from the content-addressed store, hash-verified

707
708// WriteByteSlice writes []byte to buffer using ARRAY protocol
709func WriteByteSlice(buf *ByteBuffer, value []byte) {
710 buf.WriteLength(len(value))
711 if len(value) > 0 {
712 buf.WriteBinary(value)
713 }
714}
715
716// ReadByteSlice reads []byte from buffer using ARRAY protocol
717func ReadByteSlice(buf *ByteBuffer, err *Error) []byte {

Callers

nothing calls this directly

Calls 2

WriteLengthMethod · 0.45
WriteBinaryMethod · 0.45

Tested by

no test coverage detected