(File file, InputStream is)
| 174 | } |
| 175 | |
| 176 | public static File write(File file, InputStream is) { |
| 177 | try (InputStream input = is; FileOutputStream output = new FileOutputStream(create(file))) { |
| 178 | int read; |
| 179 | byte[] buffer = new byte[16384]; |
| 180 | while ((read = input.read(buffer)) != -1) output.write(buffer, 0, read); |
| 181 | return file; |
| 182 | } catch (IOException e) { |
| 183 | return file; |
| 184 | } |
| 185 | } |
| 186 | |
| 187 | public static File write(File file, byte[] data) { |
| 188 | try (FileOutputStream fos = new FileOutputStream(create(file))) { |
no test coverage detected