@Test public void shouldCorrectlyWriteBinaryValue() { byte[] data = new byte[] {0x00, 0x01, 0x02, 0x03, 0x04, 0x05}; @SuppressWarnings( "deprecation" ) Binary binary = new Binary(Bson.BinaryType.BINARY, data); String expected = "{ \"$type\" : 2 , \"$base64\" : \"AAECAwQF\" }"; String actual = writer.write(binary); assertSame(expected, actual); }
@Override public void write( Object object, OutputStream stream ) throws IOException { Writer writer = new BufferedWriter(new OutputStreamWriter(stream, Json.UTF8)); write(object, writer); writer.flush(); }
CompactJsonWriter implements JsonWriter { @Override public void write( Object object, OutputStream stream ) throws IOException { Writer writer = new BufferedWriter(new OutputStreamWriter(stream, Json.UTF8)); write(object, writer); writer.flush(); } }
CompactJsonWriter implements JsonWriter { @Override public void write( Object object, OutputStream stream ) throws IOException { Writer writer = new BufferedWriter(new OutputStreamWriter(stream, Json.UTF8)); write(object, writer); writer.flush(); }  }
CompactJsonWriter implements JsonWriter { @Override public void write( Object object, OutputStream stream ) throws IOException { Writer writer = new BufferedWriter(new OutputStreamWriter(stream, Json.UTF8)); write(object, writer); writer.flush(); }  @Override void write( Object object,
                       OutputStream stream ); @Override void write( Object object,
                       Writer writer ); @Override void write( Object object,
                       StringBuilder writer ); @Override String write( Object object ); }
CompactJsonWriter implements JsonWriter { @Override public void write( Object object, OutputStream stream ) throws IOException { Writer writer = new BufferedWriter(new OutputStreamWriter(stream, Json.UTF8)); write(object, writer); writer.flush(); }  @Override void write( Object object,
                       OutputStream stream ); @Override void write( Object object,
                       Writer writer ); @Override void write( Object object,
                       StringBuilder writer ); @Override String write( Object object );  }