mirror of
https://github.com/golang/go.git
synced 2025-05-29 11:25:43 +00:00
add a couple of helper methods to io.ByteBuffer
R=rsc DELTA=456 (9 added, 2 deleted, 445 changed) OCL=23107 CL=23107
This commit is contained in:
parent
f48cbfdf56
commit
b74e3b95cf
@ -75,10 +75,18 @@ func (b *ByteBuffer) Len() int {
|
|||||||
return b.len
|
return b.len
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (b *ByteBuffer) Off() int {
|
||||||
|
return b.off
|
||||||
|
}
|
||||||
|
|
||||||
func (b *ByteBuffer) Data() []byte {
|
func (b *ByteBuffer) Data() []byte {
|
||||||
return b.buf[b.off:b.len]
|
return b.buf[b.off:b.len]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (b *ByteBuffer) AllData() []byte {
|
||||||
|
return b.buf[0:b.len]
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
export func NewByteBufferFromArray(buf []byte) *ByteBuffer {
|
export func NewByteBufferFromArray(buf []byte) *ByteBuffer {
|
||||||
b := new(ByteBuffer);
|
b := new(ByteBuffer);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user