1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2025-12-28 04:55:37 -05:00

rewrite alloc.buffer

This commit is contained in:
Darien Raymond
2016-12-06 11:03:42 +01:00
parent 4bf8288cc2
commit 8c8f0a53fd
51 changed files with 391 additions and 299 deletions

View File

@@ -3,6 +3,7 @@ package serial
import (
"fmt"
"strings"
"v2ray.com/core/common/alloc"
)
func ToString(v interface{}) string {
@@ -33,3 +34,10 @@ func Concat(v ...interface{}) string {
}
return strings.Join(values, "")
}
func WriteString(s string) alloc.BytesWriter {
return func(b []byte) int {
copy(b, []byte(s))
return len(s)
}
}