GetNextSymbolOrMatch() private method

private GetNextSymbolOrMatch ( Match match ) : bool
match Match
return bool
コード例 #1
0
        // compress the bytes in input history window
        private void GetCompressedOutput(OutputBuffer output)
        {
            while (inputWindow.BytesAvailable > 0 && SafeToWriteTo(output))
            {
                // Find next match. A match can be a symbol,
                // a distance/length pair, a symbol followed by a distance/Length pair
                inputWindow.GetNextSymbolOrMatch(currentMatch);

                if (currentMatch.State == MatchState.HasSymbol)
                {
                    WriteChar(currentMatch.Symbol, output);
                }
                else if (currentMatch.State == MatchState.HasMatch)
                {
                    WriteMatch(currentMatch.Length, currentMatch.Position, output);
                }
                else
                {
                    WriteChar(currentMatch.Symbol, output);
                    WriteMatch(currentMatch.Length, currentMatch.Position, output);
                }
            }
        }