The eachByte( int )
method requires a 2 parameter Closure
The first parameter is the byte buffer, the second parameter is the number of bytes that were read from the Stream. Try:
new FileInputStream(fname).eachByte(4) { buffer, nReads ->
def x = new BigInteger(buffer);
println x;
}
The same is true for File.eachByte( int )