public static void writeFile(byte[] fileData,File file) throws OpenStegoException {
  OutputStream os=null;
  try {
    if (file == null) {
      os=System.out;
    }
 else {
      os=new FileOutputStream(file);
    }
    os.write(fileData);
    os.close();
  }
 catch (  IOException ioEx) {
    throw new OpenStegoException(ioEx);
  }
}

public static void writeFile ( byte [ ] fileData , File file ) throws OpenStegoException { OutputStream os = null ; try { if ( file == null ) { os = System . out ; } else { os = new FileOutputStream ( file ) ; } os . write ( fileData ) ; os . close ( ) ; } catch ( IOException ioEx ) { throw new OpenStegoException ( ioEx ) ; } }
method to write file data to disk
