Using the byte Stream - LearnHowToCode SarkariResult.com Interview Questions and Answers LearnHowToCodeOnline
Using the byte Stream

Using the byte Stream

Using the byte Stream


   import java.io.FileInputStream;
   import java.io.FileOutputStream;
   import java.io.IOException;

     public class CopyBytes{
      public static void main(String[]arr) throws IOException
      {
         FileInputStream in=null;
         FileOutputStream out=null;

      try{
              in=new FileInputStream("abc.txt");
              out=new FileOutputStream("outagain.txt");
              int c;

                while((c=in.read())!=-1)
                    {
                out.write(c);
                   }
                   }finally{
                         if(in!=null){
                            in.close();
                         }
                         if(out!=null){
                            out.close();
                         }
                     }
                    }
             }

About EasyToCode

I'm Ethan Mariano a software engineer by profession and reader/writter by passion.I have good understanding and knowledge of AngularJS, Database, javascript, web development, digital marketing and exploring other technologies related to Software development.

0 comments:

Featured post

Political Full Forms List

Acronym Full Form MLA Member of Legislative Assembly RSS Really Simple Syndication, Rashtriya Swayamsevak Sangh UNESCO United Nations E...

Powered by Blogger.