@Test public void dumpsToAStream() throws Exception { final ByteArrayOutputStream output = new ByteArrayOutputStream(); snapshot.dump(output); assertThat(output.toString()) .isEqualTo(String.format("1%n2%n3%n4%n5%n")); }
@Override public void dump(OutputStream output) { final PrintWriter out = new PrintWriter(new OutputStreamWriter(output, UTF_8)); try { for (long value : values) { out.printf("%d%n", value); } } finally { out.close(); } }
UniformSnapshot extends AbstractSnapshot { @Override public void dump(OutputStream output) { final PrintWriter out = new PrintWriter(new OutputStreamWriter(output, UTF_8)); try { for (long value : values) { out.printf("%d%n", value); } } finally { out.close(); } } }
UniformSnapshot extends AbstractSnapshot { @Override public void dump(OutputStream output) { final PrintWriter out = new PrintWriter(new OutputStreamWriter(output, UTF_8)); try { for (long value : values) { out.printf("%d%n", value); } } finally { out.close(); } } UniformSnapshot(Collection<Long> values);  UniformSnapshot(long[] values); }
UniformSnapshot extends AbstractSnapshot { @Override public void dump(OutputStream output) { final PrintWriter out = new PrintWriter(new OutputStreamWriter(output, UTF_8)); try { for (long value : values) { out.printf("%d%n", value); } } finally { out.close(); } } UniformSnapshot(Collection<Long> values);  UniformSnapshot(long[] values); @Override double getValue(double quantile); @Override int size(); @Override long[] getValues(); @Override long getMax(); @Override long getMin(); @Override double getMean(); @Override double getStdDev(); @Override void dump(OutputStream output); }
UniformSnapshot extends AbstractSnapshot { @Override public void dump(OutputStream output) { final PrintWriter out = new PrintWriter(new OutputStreamWriter(output, UTF_8)); try { for (long value : values) { out.printf("%d%n", value); } } finally { out.close(); } } UniformSnapshot(Collection<Long> values);  UniformSnapshot(long[] values); @Override double getValue(double quantile); @Override int size(); @Override long[] getValues(); @Override long getMax(); @Override long getMin(); @Override double getMean(); @Override double getStdDev(); @Override void dump(OutputStream output);  }