1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2025-12-29 05:25:21 -05:00

merge bufio into buf

This commit is contained in:
Darien Raymond
2017-02-15 22:51:01 +01:00
parent 7199ffcaa2
commit 020b436827
16 changed files with 54 additions and 75 deletions

View File

@@ -175,17 +175,17 @@ func (b *Buffer) String() string {
return string(b.Bytes())
}
// New creates a Buffer with 8K bytes of arbitrary content.
// New creates a Buffer with 0 length and 8K capacity.
func New() *Buffer {
return mediumPool.Allocate()
}
// NewSmall returns a buffer with 2K bytes capacity.
// NewSmall returns a buffer with 0 length and 2K capacity.
func NewSmall() *Buffer {
return smallPool.Allocate()
}
// NewLocal creates and returns a buffer on current thread.
// NewLocal creates and returns a buffer with 0 length and given capacity on current thread.
func NewLocal(size int) *Buffer {
return &Buffer{
v: make([]byte, size),