// ReadSymbol reads the next symbol using the provided prefix Decoder.
ReadSymbol reads the next symbol using the provided prefix Decoder.
// ReadSymbol reads the next symbol using the provided prefix Decoder .
func (pr *Reader) ReadSymbol(pd *Decoder) uint {
	if len(pd.chunks) == 0 {
		panic(internal.ErrInvalid) 
	}
	nb := uint(pd.MinBits)
	for {
		if err := pr.PullBits(nb); err != nil {
			panic(err)
		}
		chunk := pd.chunks[uint32(pr.bufBits)&pd.chunkMask]
		nb = uint(chunk & countMask)
		if nb > uint(pd.chunkBits) {
			linkIdx := chunk >> countBits
			chunk = pd.links[linkIdx][uint32(pr.bufBits>>pd.chunkBits)&pd.linkMask]
			nb = uint(chunk & countMask)
		}
		if nb <= pr.numBits {
			pr.bufBits >>= nb
			pr.numBits -= nb
			return uint(chunk >> countBits)
		}
	}
}
func ( pr * Reader ) ReadSymbol ( pd * Decoder ) uint { if len ( pd . chunks ) == 0 { panic ( internal . ErrInvalid ) } nb := uint ( pd . MinBits ) for { if err := pr . PullBits ( nb ) ; err != nil { panic ( err ) } chunk := pd . chunks [ uint32 ( pr . bufBits ) & pd . chunkMask ] nb = uint ( chunk & countMask ) if nb > uint ( pd . chunkBits ) { linkIdx := chunk >> countBits chunk = pd . links [ linkIdx ] [ uint32 ( pr . bufBits >> pd . chunkBits ) & pd . linkMask ] nb = uint ( chunk & countMask ) } if nb <= pr . numBits { pr . bufBits >>= nb pr . numBits -= nb return uint ( chunk >> countBits ) } } }
ReadSymbol reads the next symbol using the provided prefix Decoder.
ReadSymbol reads the next symbol using the provided prefix Decoder .
// Decode with empty tree