/// <summary></summary>
/// <returns>true if the number of input bits will fit in a code with the specified version and error correction level.</returns>
private static bool willFit(int numInputBits, Version version, ErrorCorrectionLevel ecLevel)
{
// In the following comments, we use numbers of Version 7-H.
// numBytes = 196
var numBytes = version.TotalCodewords;
// getNumECBytes = 130
var ecBlocks = version.getECBlocksForLevel(ecLevel);
var numEcBytes = ecBlocks.TotalECCodewords;
// getNumDataBytes = 196 - 130 = 66
var numDataBytes = numBytes - numEcBytes;
var totalInputBytes = (numInputBits + 7) / 8;
return(numDataBytes >= totalInputBytes);
}