class PreparedStatementQuery extends QueryPacket {

    public final int commandId;
    public final Value[] parameters;

    public PreparedStatementQuery(int resultId, int maxRows, int fetchSize, boolean scrollable,
            int commandId, Value[] parameters) {
        super(resultId, maxRows, fetchSize, scrollable);
        this.commandId = commandId;
        this.parameters = parameters;
    }

    public PreparedStatementQuery(NetInputStream in, int version) throws IOException {
        super(in, version);
        commandId = in.readInt();
        int size = in.readInt();
        parameters = new Value[size];
        for (int i = 0; i < size; i++)
            parameters[i] = in.readValue();
    }

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

    @Override
    public PacketType getAckType() {
        return PacketType.STATEMENT_QUERY_ACK; // 跟StatementQuery一样
    }

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

    public static final Decoder decoder = new Decoder();

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

        super.encode(out, version);
        out.writeInt(commandId);
        int size = parameters.length;
        out.writeInt(size);
        for (int i = 0; i < size; i++) {
            out.writeValue(parameters[i]);
        }
    
<methods>public void <init>(int, int, int, boolean) ,public void <init>(com.lealone.net.NetInputStream, int) throws java.io.IOException,public void encode(com.lealone.net.NetOutputStream, int) throws java.io.IOException<variables>public final non-sealed int fetchSize,public final non-sealed int maxRows,public final non-sealed int resultId,public final non-sealed boolean scrollable