1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2025-12-26 20:15:26 -05:00

remove ToNetBuffers

This commit is contained in:
Darien Raymond
2018-08-17 11:51:59 +02:00
parent 950612544b
commit 2594f7027a
3 changed files with 25 additions and 35 deletions

View File

@@ -2,7 +2,6 @@ package buf
import (
"io"
"net"
"v2ray.com/core/common"
"v2ray.com/core/common/errors"
@@ -204,15 +203,6 @@ func (mb MultiBuffer) String() string {
return serial.Concat(v...)
}
// ToNetBuffers converts this MultiBuffer to net.Buffers. The return net.Buffers points to the same content of the MultiBuffer.
func (mb MultiBuffer) ToNetBuffers() net.Buffers {
bs := make([][]byte, len(mb))
for i, b := range mb {
bs[i] = b.Bytes()
}
return bs
}
// SliceBySize splits the beginning of this MultiBuffer into another one, for at most size bytes.
func (mb *MultiBuffer) SliceBySize(size int32) MultiBuffer {
slice := NewMultiBufferCap(10)