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

Method readTo

internal/transport/transport_test.go:84–98  ·  view source on GitHub ↗
(p []byte)

Source from the content-addressed store, hash-verified

82}
83
84func (s *Stream) readTo(p []byte) (int, error) {
85 data, err := s.read(len(p))
86 defer data.Free()
87
88 if err != nil {
89 return 0, err
90 }
91
92 if data.Len() != len(p) {
93 return 0, err
94 }
95
96 data.CopyTo(p)
97 return len(p), nil
98}
99
100type testStreamHandler struct {
101 t *http2Server

Callers 15

performOneRPCFunction · 0.95
runPingPongTestFunction · 0.95
handleStreamMethod · 0.80
handleStreamPingPongMethod · 0.80
handleStreamDelayReadMethod · 0.80
TestLargeMessageMethod · 0.80
TestGracefulCloseMethod · 0.80

Calls 4

readMethod · 0.95
CopyToMethod · 0.80
FreeMethod · 0.65
LenMethod · 0.65

Tested by

no test coverage detected