Copies all bytes from a file to an output stream. <p><b>{@link java.nio.file.Path} equivalent:</b> {@link java.nio.file.Files#copy(java.nio.file.Path, OutputStream)}. @param from the source file @param to the output stream @throws IOException if an I/O error occurs
(File from, OutputStream to)
| 298 | * @throws IOException if an I/O error occurs |
| 299 | */ |
| 300 | public static void copy(File from, OutputStream to) throws IOException { |
| 301 | asByteSource(from).copyTo(to); |
| 302 | } |
| 303 | |
| 304 | /** |
| 305 | * Copies all the bytes from one file to another. |