@Override
    public byte[] encode(M message) {
        ByteArrayOutputStream byteOut = new ByteArrayOutputStream();
        try (Writer writer = new OutputStreamWriter(byteOut, StandardCharsets.UTF_8)) {
            this.gson.toJson(message, this.type.getType(), writer);
        } catch (IOException e) {
            throw new EncodingException(e);
        }
        return byteOut.toByteArray();
    }
Implementation of {@link Codec} using {@link Gson}.

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