Commit b74e3b95 authored by Rob Pike's avatar Rob Pike

add a couple of helper methods to io.ByteBuffer

R=rsc
DELTA=456  (9 added, 2 deleted, 445 changed)
OCL=23107
CL=23107
parent f48cbfdf
......@@ -75,10 +75,18 @@ func (b *ByteBuffer) Len() int {
return b.len
}
func (b *ByteBuffer) Off() int {
return b.off
}
func (b *ByteBuffer) Data() []byte {
return b.buf[b.off:b.len]
}
func (b *ByteBuffer) AllData() []byte {
return b.buf[0:b.len]
}
export func NewByteBufferFromArray(buf []byte) *ByteBuffer {
b := new(ByteBuffer);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment