@Override
    public M decode(byte[] buf) {
        ByteArrayInputStream byteIn = new ByteArrayInputStream(buf);
        try (Reader reader = new InputStreamReader(byteIn, StandardCharsets.UTF_8)) {
            return this.gson.fromJson(reader, this.type.getType());
        } catch (IOException e) {
            throw new EncodingException(e);
        }
    }
Implementation of {@link Codec} using {@link Gson}.

@param <M> the message type
helper/src/main/java/me/lucko/helper/messaging/codec/GsonCodec.java