com.google.zxing.pdf417.decoder.DecodedBitStreamParser.add(string, string)

Here are the examples of the csharp api class com.google.zxing.pdf417.decoder.DecodedBitStreamParser.add(string, string) taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.

2 Examples 7

1. Example

View license
private static System.Text.StringBuilder multiply(System.String value1, int value2)
		{
			System.Text.StringBuilder result = new System.Text.StringBuilder(value1.Length);
			for (int i = 0; i < value1.Length; i++)
			{
				// Put zeros into the result.
				result.Append('0');
			}
			int hundreds = value2 / 100;
			int tens = (value2 / 10) % 10;
			int ones = value2 % 10;
			// Multiply by ones
			for (int j = 0; j < ones; j++)
			{
				result = add(result.ToString(), value1);
			}
			// Multiply by tens
			for (int j = 0; j < tens; j++)
			{
				result = add(result.ToString(), (value1 + '0').Substring(1));
			}
			// Multiply by hundreds
			for (int j = 0; j < hundreds; j++)
			{
				result = add(result.ToString(), (value1 + "00").Substring(2));
			}
			return result;
		}

2. Example

View license
private static System.String decodeBase900toBase10(int[] codewords, int count)
		{
			System.Text.StringBuilder accum = null;
			for (int i = 0; i < count; i++)
			{
				System.Text.StringBuilder value_Renamed = multiply(EXP900[count - i - 1], codewords[i]);
				if (accum == null)
				{
					// First time in accum=0
					accum = value_Renamed;
				}
				else
				{
					accum = add(accum.ToString(), value_Renamed.ToString());
				}
			}
			System.String result = null;
			// Remove leading '1' which was inserted to preserve
			// leading zeros
			for (int i = 0; i < accum.Length; i++)
			{
				if (accum[i] == '1')
				{
					//result = accum.substring(i + 1);
					result = accum.ToString().Substring(i + 1);
					break;
				}
			}
			if (result == null)
			{
				// No leading 1 => just write the converted number.
				result = accum.ToString();
			}
			return result;
		}