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

Function ReadByteSlice

go/fory/slice_primitive.go:717–728  ·  view source on GitHub ↗

ReadByteSlice reads []byte from buffer using ARRAY protocol

(buf *ByteBuffer, err *Error)

Source from the content-addressed store, hash-verified

715
716// ReadByteSlice reads []byte from buffer using ARRAY protocol
717func ReadByteSlice(buf *ByteBuffer, err *Error) []byte {
718 size := buf.ReadLength(err)
719 if size == 0 {
720 return make([]byte, 0)
721 }
722 if !buf.CheckReadable(size, err) {
723 return nil
724 }
725 result := make([]byte, size)
726 buf.Read(result)
727 return result
728}
729
730// WriteBoolSlice writes []bool to buffer using ARRAY protocol
731func WriteBoolSlice(buf *ByteBuffer, value []bool) {

Callers

nothing calls this directly

Calls 3

ReadLengthMethod · 0.80
CheckReadableMethod · 0.80
ReadMethod · 0.65

Tested by

no test coverage detected