public int writeGraphToFile(byte[] img,File to){
  try {
    FileOutputStream fos=new FileOutputStream(to);
    fos.write(img);
    fos.close();
  }
 catch (  java.io.IOException ioe) {
    return -1;
  }
  return 1;
}

public int writeGraphToFile ( byte [ ] img , File to ) { try { FileOutputStream fos = new FileOutputStream ( to ) ; fos . write ( img ) ; fos . close ( ) ; } catch ( java . io . IOException ioe ) { return - 1 ; } return 1 ; }
writes the graph ' s image in a file .
