func NewBufferedWriter(w io.Writer) *BufferedWriter {
	_w := NewWriter(w).(*writer)
	return &BufferedWriter{
		w:  _w,
		bw: bufio.NewWriterSize(_w, MaxBlockSize),
	}
}
NewBufferedWriter allocates and returns a BufferedWriter with an internal
buffer of MaxBlockSize bytes.  If an error occurs writing a block to w, all
future writes will fail with the same error.  After all data has been
written, the client should call the Flush method to guarantee all data has
been forwarded to the underlying io.Writer.
package snappystream
import (
	"bufio"
	"errors"
	"fmt"
	"hash/crc32"
	"io"
	"github.com/mreiferson/go-snappystream/snappy-go"
)
var errClosed = fmt.Errorf("closed")
type BufferedWriter struct {
	err error
	w   *writer
	bw  *bufio.Writer
}