@OP,
Why dont you do it another way and make up your own binary file of ints (32 bit ints) with a known number of 3's Just use a random number generator in a loop and count the 3's as they are filed.
Then once you have that run your test program and check the result.
All of that is a simple couple pf lines modification to the sample I posted above.