func NewWriter(w io.Writer) *BitWriter {
	b := new(BitWriter)
	b.w = w
	b.count = 8
	return b
}
NewWriter returns a BitWriter that buffers bits and write the resulting bytes to 'w'
package bitstream
import (
	"io"
)
type Bit bool
const (
	Zero Bit = false
	One Bit = true
)
type BitReader struct {
	r     io.Reader
	b     [1]byte
	count uint8
}
type BitWriter struct {
	w     io.Writer
	b     [1]byte
	count uint8
}
func NewReader(r io.Reader) *BitReader {
	b := new(BitReader)
	b.r = r
	return b
}
func (b *BitReader) ReadBit() (Bit, error) {
	if b.count == 0 {
		if n, err := b.r.Read(b.b[:]); n != 1 || (err != nil && err != io.EOF) {
			return Zero, err
		}
		b.count = 8
	}
	b.count--
	d := (b.b[0] & 0x80)
	b.b[0] <<= 1
	return d != 0, nil
}