private void inlineCSS() { try (final InputStream css = this.cssURL.openStream()) { final byte[] buffer = new byte[4096]; int n; while ((n = css.read(buffer)) > 0) { this.stream.write(buffer, 0, n); } } catch (final IOException e) { throw new ReportException("Unable to copy CSS content \"" + this.cssURL.toString() + "\" trying to generate HTML view.", e); } }
private void inlineCSS() { try (final InputStream css = this.cssURL.openStream()) { final byte[] buffer = new byte[4096]; int n; while ((n = css.read(buffer)) > 0) { this.stream.write(buffer, 0, n); } } catch (final IOException e) { throw new ReportException("Unable to copy CSS content \"" + this.cssURL.toString() + "\" trying to generate HTML view.", e); } }
public void reportTraceToPath(final Trace trace, final Path outputPath, final ReportSettings settings) { try (OutputStream outputStream = Files.newOutputStream(outputPath)) { reportTraceToStream(trace, outputStream, settings); } catch (final IOException e) { throw new ReportException("Error generating stream to output path " + outputPath, e); } }
public void reportTraceToPath(final Trace trace, final Path outputPath, final ReportSettings settings) { try (OutputStream outputStream = Files.newOutputStream(outputPath)) { reportTraceToStream(trace, outputStream, settings); } catch (final IOException e) { throw new ReportException("Error generating stream to output path " + outputPath, e); } }
@Override public void renderToStream(final OutputStream outputStream) { final Charset charset = StandardCharsets.UTF_8; try (final PrintStream report = new PrintStream(outputStream, false, charset.displayName())) { renderToPrintStream(report); } catch (final UnsupportedEncodingException e) { throw new ReportException("Encoding charset '" + charset + "' not supported", e); } }
@Override public void renderToStream(final OutputStream outputStream) { final Charset charset = StandardCharsets.UTF_8; try (final PrintStream report = new PrintStream(outputStream, false, charset.displayName())) { renderToPrintStream(report); } catch (final UnsupportedEncodingException e) { throw new ReportException("Encoding charset '" + charset + "' not supported", e); } }
private void reportTraceToStream(final Trace trace, final OutputStream outputStream, final ReportSettings settings) { final Reportable report = createReport(trace, settings); report.renderToStream(outputStream); try { outputStream.flush(); } catch (final IOException exception) { throw new ReportException(exception.getMessage()); } }
private void reportTraceToStream(final Trace trace, final OutputStream outputStream, final ReportSettings settings) { final Reportable report = createReport(trace, settings); report.renderToStream(outputStream); try { outputStream.flush(); } catch (final IOException exception) { throw new ReportException(exception.getMessage()); } }