class StatementQueryAck implements AckPacket {

    public final Result result;
    public final int rowCount;
    public final int columnCount;
    public final int fetchSize;
    public final NetInputStream in;

    public StatementQueryAck(Result result, int rowCount, int fetchSize) {
        this.result = result;
        this.rowCount = rowCount;
        this.fetchSize = fetchSize;
        columnCount = result.getVisibleColumnCount();
        in = null;
    }

    public StatementQueryAck(NetInputStream in, int version) throws IOException {
        result = null;
        rowCount = in.readInt();
        columnCount = in.readInt();
        fetchSize = in.readInt();
        this.in = in;
    }

    @Override
    public PacketType getType() {
        return PacketType.STATEMENT_QUERY_ACK;
    }

    @Override
    public void encode(NetOutputStream out, int version) throws IOException {<FILL_FUNCTION_BODY>}

    // ----------------------------------------------------------------
    // 因为查询结果集是lazy解码的，所以子类的字段需要提前编码和解码
    // ----------------------------------------------------------------
    public void encodeExt(NetOutputStream out, int version) throws IOException {
    }

    public static final Decoder decoder = new Decoder();

    private static class Decoder implements PacketDecoder<StatementQueryAck> {
        @Override
        public StatementQueryAck decode(NetInputStream in, int version) throws IOException {
            return new StatementQueryAck(in, version);
        }
    }
}

        out.writeInt(rowCount);
        out.writeInt(columnCount);
        out.writeInt(fetchSize);
        encodeExt(out, version);
        for (int i = 0; i < columnCount; i++) {
            PreparedStatementGetMetaDataAck.writeColumn(out, result, i);
        }
        ResultFetchRowsAck.writeRow(out, result, fetchSize);
    
<no_super_class>