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

Function ReadInt8Slice

go/fory/slice_primitive.go:763–774  ·  view source on GitHub ↗

ReadInt8Slice reads []int8 from buffer using ARRAY protocol

(buf *ByteBuffer, err *Error)

Source from the content-addressed store, hash-verified

761
762// ReadInt8Slice reads []int8 from buffer using ARRAY protocol
763func ReadInt8Slice(buf *ByteBuffer, err *Error) []int8 {
764 size := buf.ReadLength(err)
765 if size == 0 {
766 return make([]int8, 0)
767 }
768 if !buf.CheckReadable(size, err) {
769 return nil
770 }
771 result := make([]int8, size)
772 buf.Read(unsafe.Slice((*byte)(unsafe.Pointer(&result[0])), size))
773 return result
774}
775
776// WriteInt16Slice writes []int16 to buffer using ARRAY protocol
777func WriteInt16Slice(buf *ByteBuffer, value []int16) {

Callers 2

ReadDataMethod · 0.85
ReadInt8SliceMethod · 0.85

Calls 4

ReadLengthMethod · 0.80
CheckReadableMethod · 0.80
SliceMethod · 0.80
ReadMethod · 0.65

Tested by

no test coverage detected