code: public int writeGraphToFile(byte[] img, File to)
  	{
  		try
  		{
  			FileOutputStream fos = new FileOutputStream(to);
  			fos.write(img);
  			fos.close();
  		} catch (IOException ioe)
  		{
  			return -1;
  		}
  
  		return 1;
  
  	}
docs: Writes the graph's image in a file.
  
  @param img
  A byte array containing the image of the graph.
  @param to
  A File object to where we want to write.
  @return Success: 1, Failure: -1