### Question:
AbstractJsonStreamFormat extends ConfigurableBinaryStreamFormat<T> { @Override public ModelOutput<T> createOutput( Class<? extends T> dataType, String path, OutputStream stream) throws IOException, InterruptedException { JsonFormat<T> format = getJsonFormat(); Set<OutputOption> options = OUTPUT_OPTS; OutputStream destination = decorate(stream); return new DecoratedOutput(format.open(path, destination, options), new StringOption(path)); }  final JsonFormat<T> getJsonFormat(); @Override final long getPreferredFragmentSize(); @Override final long getMinimumFragmentSize(); @Override ModelInput<T> createInput(
            Class<? extends T> dataType,
            String path,
            InputStream stream,
            long offset, long fragmentSize); @Override ModelOutput<T> createOutput(
            Class<? extends T> dataType,
            String path,
            OutputStream stream);  }### Answer:
@Test public void output() throws Exception { MockFormat format = format(1); int[][] data = { { 100 } }; ByteArrayOutputStream output = new ByteArrayOutputStream(); try (ModelOutput<int[]> out = format.createOutput(int[].class, "dummy", output)) { dump(out, data); } assertThat(deserialize(output.toByteArray()), is(data)); }
@Test public void output_compression() throws Exception { MockFormat format = format(1) .withCodecClass(GzipCodec.class); int[][] data = { { 100 } }; ByteArrayOutputStream output = new ByteArrayOutputStream(); try (ModelOutput<int[]> out = format.createOutput(int[].class, "dummy", output)) { dump(out, data); } ByteArrayOutputStream buf = new ByteArrayOutputStream(); try (InputStream in = new GZIPInputStream(new ByteArrayInputStream(output.toByteArray()))) { IOUtils.copy(in, buf); } assertThat(deserialize(buf.toByteArray()), is(data)); }