// Read reads bytes into buf.
// The bit-ordering mode does not affect this method.
Read reads bytes into buf.
The bit-ordering mode does not affect this method.
// Read reads bytes into buf . // The bit - ordering mode does not affect this method .
func (pr *Reader) Read(buf []byte) (cnt int, err error) {
	if pr.numBits > 0 {
		if pr.numBits%8 != 0 {
			return 0, internal.Error{"non-aligned bit buffer"}
		}
		for cnt = 0; len(buf) > cnt && pr.numBits > 0; cnt++ {
			buf[cnt] = pr.transform[byte(pr.bufBits)]
			pr.bufBits >>= 8
			pr.numBits -= 8
		}
		return cnt, nil
	}
	if _, err := pr.Flush(); err != nil {
		return 0, err
	}
	cnt, err = pr.rd.Read(buf)
	pr.Offset += int64(cnt)
	return cnt, err
}
func ( pr * Reader ) Read ( buf [ ] byte ) ( cnt int , err error ) { if pr . numBits > 0 { if pr . numBits % 8 != 0 { return 0 , internal . Error { " " } } for cnt = 0 ; len ( buf ) > cnt && pr . numBits > 0 ; cnt ++ { buf [ cnt ] = pr . transform [ byte ( pr . bufBits ) ] pr . bufBits >>= 8 pr . numBits -= 8 } return cnt , nil } if _ , err := pr . Flush ( ) ; err != nil { return 0 , err } cnt , err = pr . rd . Read ( buf ) pr . Offset += int64 ( cnt ) return cnt , err }
Read reads bytes into buf.
Read reads bytes into buf .