JAVA Program to Insert Data in File Byte by Byte

JAVA Program to Insert Data in File Byte by Byte:

import java.io.*;
class file1
{
 public static void main(String args[])
 {
  FileOutputStream fr=null;
  try
  {

   fr=new FileOutputStream("abc.txt");
   byte a[]={'A','B','C','D','1'};
   fr.write(a);
  }
  catch(Exception e){}

  finally
  {
      try
      {
   fr.close();
}
catch(Exception e){}
  }
 }
}

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.