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

Function NewInputStreamWithBufferSize

go/fory/stream.go:40–45  ·  view source on GitHub ↗

NewInputStreamWithBufferSize creates a new InputStream with a specified minimum buffer size.

(r io.Reader, bufferSize int)

Source from the content-addressed store, hash-verified

38
39// NewInputStreamWithBufferSize creates a new InputStream with a specified minimum buffer size.
40func NewInputStreamWithBufferSize(r io.Reader, bufferSize int) *InputStream {
41 buf := NewByteBufferFromReader(r, bufferSize)
42 return &InputStream{
43 buffer: buf,
44 }
45}
46
47// Shrink compacts the internal buffer, dropping already-read bytes to reclaim memory.
48// It applies a heuristic to avoid tiny frequent compactions and reallocates the backing

Callers 3

NewInputStreamFunction · 0.85
TestInputStreamShrinkFunction · 0.85

Calls 1

NewByteBufferFromReaderFunction · 0.85

Tested by 2

TestInputStreamShrinkFunction · 0.68