Three ways to read a number for a BitInputStream
If you are so concerned about performance, then you should run a benchmark.  I would bet that there is no appreciable difference in performance, as the task is going to be IO-bound rather than CPU-bound.  A much bigger impact on performance would be, for example, whether the input stream is buffered.  Therefore, you should just pick the code that looks the best.  I personally prefer a variant of variant 3.

It seems that you are interested in the values of value and aNumberOfBits after the loop.  Since i is unimportant, let's just ditch it.  Also, iBuffer seems to be a temporary variable, so its scope should be limited to the loop.

Finally, let's get rid of the Hungarian notation!

for (; bitCount &gt;= 8; bitCount -= 8) {
    int b = input.read();
    if (b == -1) {
        throw new EOFException();
    }
    value = (value &lt;&lt; 8) | b;
}


What might make a performance impact is reading a byte[] array at once instead of a byte at a time.  Handling possible buffer underruns correctly would be a pain, though, so I don't recommend it here.