// TryReadSymbol attempts to decode the next symbol using the contents of the
// bit buffer alone. It returns the decoded symbol and whether it succeeded.
//
// This method is designed to be inlined for performance reasons.
TryReadSymbol attempts to decode the next symbol using the contents of the
bit buffer alone. It returns the decoded symbol and whether it succeeded.

This method is designed to be inlined for performance reasons.
// TryReadSymbol attempts to decode the next symbol using the contents of the // bit buffer alone . It returns the decoded symbol and whether it succeeded . // // This method is designed to be inlined for performance reasons .
func (pr *Reader) TryReadSymbol(pd *Decoder) (uint, bool) {
	if pr.numBits < uint(pd.MinBits) || len(pd.chunks) == 0 {
		return 0, false
	}
	chunk := pd.chunks[uint32(pr.bufBits)&pd.chunkMask]
	nb := uint(chunk & countMask)
	if nb > pr.numBits || nb > uint(pd.chunkBits) {
		return 0, false
	}
	pr.bufBits >>= nb
	pr.numBits -= nb
	return uint(chunk >> countBits), true
}
func ( pr * Reader ) TryReadSymbol ( pd * Decoder ) ( uint , bool ) { if pr . numBits < uint ( pd . MinBits ) || len ( pd . chunks ) == 0 { return 0 , false } chunk := pd . chunks [ uint32 ( pr . bufBits ) & pd . chunkMask ] nb := uint ( chunk & countMask ) if nb > pr . numBits || nb > uint ( pd . chunkBits ) { return 0 , false } pr . bufBits >>= nb pr . numBits -= nb return uint ( chunk >> countBits ) , true }
TryReadSymbol attempts to decode the next symbol using the contents of the
bit buffer alone.
TryReadSymbol attempts to decode the next symbol using the contents of the bit buffer alone .