MCPcopy
hub / github.com/grpc/grpc-go / Materialize

Method Materialize

mem/buffer_slice.go:89–97  ·  view source on GitHub ↗

Materialize concatenates all the underlying Buffer's data into a single contiguous buffer using CopyTo.

()

Source from the content-addressed store, hash-verified

87// Materialize concatenates all the underlying Buffer's data into a single
88// contiguous buffer using CopyTo.
89func (s BufferSlice) Materialize() []byte {
90 l := s.Len()
91 if l == 0 {
92 return nil
93 }
94 out := make([]byte, l)
95 s.CopyTo(out)
96 return out
97}
98
99// MaterializeToBuffer functions like Materialize except that it writes the data
100// to a single Buffer pulled from the given BufferPool.

Callers 15

EncodeMethod · 0.95
TestBufferSlice_RefMethod · 0.95
ExampleNewWriterFunction · 0.95
processUnaryRPCMethod · 0.80
UnmarshalMethod · 0.80
SendMsgMethod · 0.80
RecvMsgMethod · 0.80
SendMsgMethod · 0.80
RecvMsgMethod · 0.80
TestSimpleParsingMethod · 0.80
TestMultipleParsingMethod · 0.80

Calls 2

LenMethod · 0.95
CopyToMethod · 0.95

Tested by 9

TestBufferSlice_RefMethod · 0.76
ExampleNewWriterFunction · 0.76
TestSimpleParsingMethod · 0.64
TestMultipleParsingMethod · 0.64
TestEncodeMethod · 0.64
TestDecompressMethod · 0.64