@Override public void serialize( Options options, Writer writer, @Optional Object object ) { try { ByteArrayOutputStream output = new ByteArrayOutputStream(); serialize( options, output, object ); byte[] base64 = Base64.getEncoder().encode( output.toByteArray() ); writer.write( new String( base64, UTF_8 ) ); } catch( IOException ex ) { throw new UncheckedIOException( ex ); } } }
@Override public void serialize( Options options, Writer writer, @Optional Object object ) { try { ByteArrayOutputStream output = new ByteArrayOutputStream(); serialize( options, output, object ); byte[] base64 = Base64.getEncoder().encode( output.toByteArray() ); writer.write( new String( base64, UTF_8 ) ); } catch( IOException ex ) { throw new UncheckedIOException( ex ); } } }