Problem with implementing a bitwise AND problem in Java
<p>I am trying to solve a problem that involves basically implementing a logical AND between the input parameter.</p>

<p>The complexity of the problem involves the size of the input parameters. To give a high level overview, I am trying to implement the logic similar to</p>

<pre><code>100 &amp; 100 == 100
001 &amp; 010 == 0
001 &amp; 100 == 0
.....
</code></pre>

<p>The complexity is that some of the input parameters can be 400 bits long. Its not a true binary number representation. It's more of a positional representation. The same input can be represented as</p>

<pre><code>100 = x1; (or) x100
011 = x2,3; (or) x011
001.......11 = x3,......450,451;
</code></pre>

<p>So basically "x" is just a prefix with the value for it. This is an ACL system designed a long time ago and I am trying to implement a Java version for it.</p>

<p>I couldn't find a data type in Java that could be used to represent a binary representation that is as huge as having 400 bits. I can also use the decimal representation [ie., x2,3] and solve it too, but I couldn't think of way other than looping through the entire number range and comparing it with the other input parameter. Both input parameters could be normalized to the same representation format [ie., binary or decimal].</p>

<p>Any suggestions (or) help on how I can solve this problem?</p>
