MCPcopy Create free account
hub / github.com/brimdata/super / ReadCSUP

Function ReadCSUP

fuzz/fuzz.go:49–62  ·  view source on GitHub ↗
(bs []byte, fields []field.Path)

Source from the content-addressed store, hash-verified

47}
48
49func ReadCSUP(bs []byte, fields []field.Path) ([]super.Value, error) {
50 bytesReader := bytes.NewReader(bs)
51 context := super.NewContext()
52 reader, err := csupio.NewReader(context, bytesReader, fields)
53 if err != nil {
54 return nil, err
55 }
56 var a sbuf.Array
57 err = sio.Copy(&a, reader)
58 if err != nil {
59 return nil, err
60 }
61 return a.Values(), nil
62}
63
64func WriteBSUP(t testing.TB, valuesIn []super.Value, buf *bytes.Buffer) {
65 writer := bsupio.NewWriter(sio.NopCloser(buf))

Callers 1

roundtripFunction · 0.92

Calls 5

ValuesMethod · 0.95
NewContextFunction · 0.92
NewReaderFunction · 0.92
CopyFunction · 0.92
NewReaderMethod · 0.45

Tested by 1

roundtripFunction · 0.74