4 Replies Latest reply on Jun 23, 2008 4:01 AM by EJP

    How to Write A Binary File.

      I am creating a program which will save data but i want this data to be encrypted/or unreadable.

      I have created a simple console application which reads users input changes it into bytes and saves it to a file.
      But its still saving it as readable text? any ideas?
                     Scanner in = new Scanner(System.in);
                     FileOutputStream fos;
                          fos= new FileOutputStream(new File("data.txt"));
                          System.out.print("Enter String: ");          
                          String msg = in.nextLine();
                          byte[] wordInBytes = msg.getBytes();
                     catch(Exception e)
      Thank you for any help,