Add a bytes method to alloc.buffer

pull/62/head
v2ray 2015-12-15 00:53:27 +01:00
parent 05caf04eee
commit e2acec745c
1 changed files with 4 additions and 0 deletions

View File

@ -40,6 +40,10 @@ func (b *Buffer) Append(data []byte) *Buffer {
return b
}
func (b *Buffer) Bytes() []byte {
return b.Value
}
// Slice cuts the buffer at the given position.
func (b *Buffer) Slice(from, to int) *Buffer {
b.Value = b.Value[from:to]