json/src/main/java/io/airlift/json/JsonCodec.java
public T fromJson(byte[] json)
            throws IllegalArgumentException
    {
        try {
            return mapper.readValue(json, javaType);
        }
        catch (IOException e) {
            throw new IllegalArgumentException(format("Invalid JSON bytes for %s", javaType), e);
        }
    }
public T fromJson(byte[] json)
            throws IllegalArgumentException
    {
        try {
            return mapper.readValue(json, javaType);
        }
        catch (IOException e) {
            throw new IllegalArgumentException(format("Invalid JSON bytes for %s", javaType), e);
        }
    }
Coverts the specified json bytes (UTF-8) into an instance of type T.

@param json the json bytes (UTF-8) to parse
@return parsed response; never null
@throws IllegalArgumentException if the json bytes can not be converted to the type T