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

Function SplitUnsafe

mem/buffers.go:256–258  ·  view source on GitHub ↗

SplitUnsafe modifies the receiver to point to the first n bytes while it returns a new reference to the remaining bytes. The returned Buffer functions just like a normal reference acquired using Ref().

(buf Buffer, n int)

Source from the content-addressed store, hash-verified

254// returns a new reference to the remaining bytes. The returned Buffer
255// functions just like a normal reference acquired using Ref().
256func SplitUnsafe(buf Buffer, n int) (left, right Buffer) {
257 return buf.split(n)
258}
259
260type emptyBuffer struct{}
261

Callers 4

ReadMethod · 0.92
readAdditionalMethod · 0.92
TestBuffer_SplitMethod · 0.92

Calls 1

splitMethod · 0.65

Tested by 2

TestBuffer_SplitMethod · 0.74