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

Method Reset

go/fory/buffer.go:489–498  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

487}
488
489func (b *ByteBuffer) Reset() {
490 b.readerIndex = 0
491 b.writerIndex = 0
492 b.reader = nil
493 // Keep the underlying buffer if it's reasonable sized to reduce allocations
494 // Only nil it out if we want to release memory
495 if cap(b.data) > 64*1024 {
496 b.data = nil
497 }
498}
499
500func (b *ByteBuffer) ResetWithReader(r io.Reader, bufferSize int) {
501 b.readerIndex = 0

Calls

no outgoing calls