]> Cypherpunks repositories - gostls13.git/commitdiff
add a couple of helper methods to io.ByteBuffer
authorRob Pike <r@golang.org>
Tue, 20 Jan 2009 20:57:25 +0000 (12:57 -0800)
committerRob Pike <r@golang.org>
Tue, 20 Jan 2009 20:57:25 +0000 (12:57 -0800)
R=rsc
DELTA=456  (9 added, 2 deleted, 445 changed)
OCL=23107
CL=23107

src/lib/io/bytebuffer.go

index 59547afb4a58e45f3e413a6028b871877e994847..5faeff9eb740f8c48dafd31e94884d7897d760ac 100644 (file)
@@ -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);