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:
@@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user