Write the bytes from the byte array to the File.

@param file  the file to write to
@param bytes the byte[] to write to the file
@throws IOException if an IOException occurs.
@since 1.7.1
549938
public static void setBytes(File file, byte[] bytes) throws IOException {
        IOGroovyMethods.setBytes(new FileOutputStream(file), bytes);
    }
841119
@Override
  public void write(byte[] b) throws IOException {
    for (OutputStream child : children) {
      child.write(b);
    }
  }
1162282
public static byte[] readBytes(File file) throws IOException {
        byte[] bytes = new byte[(int) file.length()];
        FileInputStream fileInputStream = new FileInputStream(file);
        DataInputStream dis = new DataInputStream(fileInputStream);
        try {
            dis.readFully(bytes);
            InputStream temp = dis;
            dis = null;
            temp.close();
        } finally {
            closeWithWarning(dis);
        }
        return bytes;
    }
299764
public static void storeByteArrayToFile(final byte[] data, final File file) throws IOException
	{
		try (FileOutputStream fos = new FileOutputStream(file);
			BufferedOutputStream bos = new BufferedOutputStream(fos);)
		{
			bos.write(data);
			bos.flush();
		}
	}
1315383
public void write (byte[] buf, int off, int len)
            throws IOException
     {
            out.write (buf, off, len);
     }
470029
public static void setBytes(Path self, byte[] bytes) throws IOException {
        IOGroovyMethods.setBytes(Files.newOutputStream(self), bytes);
    }
600393
public void sendFile(File file, OutputStream os) throws IOException {
        FileInputStream is = null;
        BufferedInputStream buf = null;;
        try {
            is = new FileInputStream(file);
            buf = new BufferedInputStream(is);
            int readBytes = 0;
            if (LOGGER.isDebugEnabled()) {
                LOGGER.debug("Writing file...");
            }
            while ((readBytes = buf.read()) != -1) {
                os.write(readBytes);
            }
            os.flush();
            if (LOGGER.isDebugEnabled()) {
                LOGGER.debug("File written");
            }
        } finally {
            if (is != null) {
                is.close();
            }
            if (buf != null) {
                buf.close();
            }
        }
    }
493819
public void writeToFile(File file) {
        try {
            try (OutputStream os = new FileOutputStream(file)) {
                InputStreams.transferTo(body(), os);
            }
        } catch (IOException e) {
            throw new RequestsException(e);
        } finally {
            close();
        }
    }
1091480
public void write(byte[] b) throws IOException {
	if (b != null && b.length > 0) {
	    pos += blob.write(b, 0, pos, b.length);
	}
    }
406653
public static void writeAtomically(File file, byte[] bytes) throws IOException {
		AtomicFile atomicFile = new AtomicFile(file);
		FileOutputStream stream = null;
		try {
			stream = atomicFile.startWrite();
			stream.write(bytes);
			atomicFile.finishWrite(stream); // serialization was successful
		} catch (Exception e) {
			atomicFile.failWrite(stream); // serialization failed
			throw new IOException(e); // throw exception up the chain
		}
	}
1166037
public void write(File file) {
    FileOutputStream out = null;
    try {
      out = new FileOutputStream(file, false);
      workbook.write(out);
    } catch (FileNotFoundException e) {
      throw new RuntimeException(e);
    } catch (IOException e) {
      new RuntimeException(e);
    } finally {
      if (out != null)
        try {
          out.close();
        } catch (IOException e) {
          new RuntimeException(e);
        }
    }
  }
911960
public static void write(final PublicKey publicKey, final @NonNull File file) throws IOException
	{
		write(publicKey, new FileOutputStream(file));
	}
611274
public void saveTo(File file) throws IOException {
		FileWriter writer = new FileWriter(file);
		try {
			writer.write(getAbcString());
		} finally {
			writer.close();
		}
	}
866970
public static byte[] readBytes(File file) throws IOException {
        FileInputStream fis = null;
        ByteArrayOutputStream bos = null;
        if (file == null) {
            throw new FileNotFoundException("No file specified");
        }
        try {
            fis = new FileInputStream(file);
            bos = new ByteArrayOutputStream();
            byte[] buffer = new byte[BUFFER_SIZE];
            int remaining;
            while ((remaining = fis.read(buffer)) > 0) {
                bos.write(buffer, 0, remaining);
            }
            return bos.toByteArray();
        } finally {
            Closeables.closeQuietly(fis);
            Closeables.closeQuietly(bos);
        }
    }
534343
public void write(byte []buffer, int offset, int length)
    throws IOException
  {
    _file.write(buffer, offset, length);
  }
195791
@Override
    public void write(byte[] b, int off, int len) throws IOException {
        if (b.length == 0)
            return;
        fos().write(b, off, len);
        currFileBytesWritten += len;
        totalBytesWritten += len;
    }
1213740
protected long writeByteArrayValue(File file, ValueData value) throws IOException
   {
      OutputStream out = new FileOutputStream(file);
      try
      {
         byte[] data = value.getAsByteArray();
         out.write(data);

         return data.length;
      }
      finally
      {
         out.close();
      }
   }