Opening Hours :7AM to 9PM
byte b[]; ... ... logic ... bos.write(b);
import java.io.*; class Main { public static void main(String args[])throws Exception{ FileOutputStream fout1=new FileOutputStream("abc.txt"); ByteArrayOutputStream bout=new ByteArrayOutputStream(); for(int x=1;x<=100;x++) { bout.write(x); } bout.writeTo(fout1); bout.close(); System.out.println("Success..."); } }Using ByteArrayOutputStream data can be transfer to a file with a faster rate.