bufferpool

package
v1.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 1, 2022 License: MIT Imports: 3 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Copy

func Copy(dst io.Writer, src io.Reader) (written int64, err error)

基于pool 的io.copy

func Copy2 added in v0.0.4

func Copy2(dst io.Writer, src io.Reader) (written int64, err error)

* 改进bufferpool中的copy方法,不使用sync.pool,使用bytebufferpool

Types

type BufferPool

type BufferPool interface {
	Get() []byte
	Put([]byte)
}

A BufferPool is an interface for getting and returning temporary byte slices for use by io.CopyBuffer.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL