class JsonEntitySerializer implements EntitySerializer {

    @Override
    public void serialize(final Object entity, final OutputStream out) throws IOException {
        final JsonFactory factory = new JsonFactory();
        final JsonGenerator generator = factory.createGenerator(out);
        generator.setCodec(jsonCodec);
        generator.writeObject(entity);
        generator.flush();
    }

    public  JsonEntitySerializer(final ObjectMapper jsonCodec);

}