class JsonType extends PGType<Object> {

    public static final JsonType INSTANCE = new JsonType();
    static final int OID = 114;

    private static final int TYPE_LEN = -1;
    private static final int TYPE_MOD = -1;

    private JsonType() {
        super(OID, TYPE_LEN, TYPE_MOD, "json");
    }

    @Override
    public int typArray() {
        return PGArray.JSON_ARRAY.oid();
    }

    @Override
    public String typeCategory() {
        return TypeCategory.USER_DEFINED_TYPES.code();
    }

    @Override
    public String type() {
        return Type.BASE.code();
    }

    @Override
    public Regproc typSend() {
        return Regproc.of("json_send");
    }

    @Override
    public Regproc typReceive() {
        return Regproc.of("json_recv");
    }

    @Override
    public int writeAsBinary(ByteBuf buffer, @NotNull Object value) {
        byte[] bytes = encodeAsUTF8Text(value);
        buffer.writeInt(bytes.length);
        buffer.writeBytes(bytes);
        return INT32_BYTE_SIZE + bytes.length;
    }

    @Override
    protected byte[] encodeAsUTF8Text(@NotNull Object value) {<FILL_FUNCTION_BODY>}

    @Override
    public Object readBinaryValue(ByteBuf buffer, int valueLength) {
        byte[] bytes = new byte[valueLength];
        buffer.readBytes(bytes);
        return decodeUTF8Text(bytes);
    }

    @Override
    Object decodeUTF8Text(byte[] bytes) {
        try {
            XContentParser parser = JsonXContent.JSON_XCONTENT.createParser(
                NamedXContentRegistry.EMPTY, DeprecationHandler.THROW_UNSUPPORTED_OPERATION, bytes);
            if (bytes.length > 1 && bytes[0] == '[') {
                parser.nextToken();
                return parser.list();
            }
            return parser.map();
        } catch (IOException e) {
            throw new RuntimeException(e);
        }
    }
}

        if (value instanceof String str) {
            return str.getBytes(StandardCharsets.UTF_8);
        }
        try {
            XContentBuilder builder = JsonXContent.builder();
            if (value instanceof List<?> values) {
                builder.startArray();
                for (Object o : values) {
                    builder.value(o);
                }
                builder.endArray();
            } else {
                builder.map((Map) value);
            }
            builder.close();
            return BytesReference.toBytes(BytesReference.bytes(builder));
        } catch (IOException e) {
            throw new RuntimeException(e);
        }
    
<methods>public int oid() ,public abstract java.lang.Object readBinaryValue(ByteBuf, int) ,public java.lang.Object readTextValue(ByteBuf, int) ,public abstract int typArray() ,public java.lang.String typDelim() ,public int typElem() ,public io.crate.types.Regproc typInput() ,public java.lang.String typName() ,public io.crate.types.Regproc typOutput() ,public io.crate.types.Regproc typReceive() ,public io.crate.types.Regproc typSend() ,public abstract java.lang.String type() ,public abstract java.lang.String typeCategory() ,public short typeLen() ,public int typeMod() ,public abstract int writeAsBinary(ByteBuf, java.lang.Object) ,public int writeAsText(ByteBuf, java.lang.Object) <variables>static final int INT32_BYTE_SIZE,private static final Logger LOGGER,private final non-sealed int oid,private final non-sealed java.lang.String typName,private final non-sealed int typeLen,private final non-sealed int typeMod