I\'m using a loop like this to determine a bit value, and writing it as a bit to a buffer out:
out
for (int