/src/main/java/org/htmlunit/util/DebuggingWebConnection.java
final File file = createFile ( request.getUrl ( ) , extension ) ;
} } protected void saveResponse(final WebResponse response, final WebRequest request) throws IOException { counter_++; final String extension = chooseExtension(response.getContentType()); <extra_id_0> int length = 0; try (InputStream input = response.getContentAsStream()) { try (OutputStream fos = Files.newOutputStream(file.toPath())) { length = IOUtils.copy(input, fos); } catch (final EOFException e) {