Initial commit

This commit is contained in:
2022-06-02 08:05:25 +02:00
commit dfbbc0ee5f
316 changed files with 151609 additions and 0 deletions
+18
View File
@@ -0,0 +1,18 @@
package sdk
import (
"io"
"sync"
)
const buffer32K = 32 * 1024
var buffer32KPool = &sync.Pool{New: func() interface{} { return make([]byte, buffer32K) }}
// copyBuf uses a shared buffer pool with io.CopyBuffer
func copyBuf(w io.Writer, r io.Reader) (int64, error) {
buf := buffer32KPool.Get().([]byte)
written, err := io.CopyBuffer(w, r, buf)
buffer32KPool.Put(buf)
return written, err
}