func (b *Buffer) Bytes() []byte {
    return b.buf[b.off:]
}
Return the unread portion of the buffer as slice.
package packet
import "encoding/binary"
type Buffer struct {
    buf       []byte
    off       int
    layer_off int
}
func (b *Buffer) Init(buf []byte) {
    b.buf = buf
    b.off = 0
    b.layer_off = 0
}