FileOutputStream output = new FileOutputStream("output.txt"); ... byte b = 0; ... output.write(b); ... write.close();