class JsonCodec implements ContentCodec {

    @Override
    public <T> T bytesToValue(byte[] body,
                              DataSchema<T> schema,
                              Map<String, String> parameters) throws ContentCodecException {
        try {
            return getMapper().readValue(body, schema.getClassType());
        }
        catch (IOException e) {
            throw new ContentCodecException("Failed to decode " + getMediaType() + ": " + e.toString());
        }
    }

}