func BufferReader(reader io.Reader) *Buffer {
	b := &Buffer{
		lock: &sync.Mutex{},
	}
	go func() {
		io.Copy(b, reader)
		b.Close()
	}()
	return b
}
/*
BufferReader returns a new gbytes.Buffer that wraps a reader.  The reader's contents are read into
the Buffer via io.Copy
package gbytes
import (
	"errors"
	"fmt"
	"io"
	"regexp"
	"sync"
	"time"
)
type Buffer struct {
	contents     []byte
	readCursor   uint64
	lock         *sync.Mutex
	detectCloser chan interface{}
	closed       bool
}
func NewBuffer() *Buffer {
	return &Buffer{
		lock: &sync.Mutex{},
	}
}
func BufferWithBytes(bytes []byte) *Buffer {
	return &Buffer{
		lock:     &sync.Mutex{},
		contents: bytes,
	}
}