docs: public static void writeCmd(final int statementId, final ParameterHolder[] parameters,
        final int parameterCount,
        ColumnType[] parameterTypeHeader, final PacketOutputStream pos,
        final byte cursorFlag) throws IOException {
      pos.write(Packet.COM_STMT_EXECUTE);
      pos.writeInt(statementId);
      pos.write(cursorFlag);
      pos.writeInt(1); //Iteration pos
  
      //create null bitmap
      if (parameterCount > 0) {
        int nullCount = (parameterCount + 7) / 8;
  
        byte[] nullBitsBuffer = new byte[nullCount];
        for (int i = 0; i < parameterCount; i++) {
          if (parameters[i].isNullData()) {
            nullBitsBuffer[i / 8] |= (1 << (i % 8));
          }
        }
        pos.write(nullBitsBuffer, 0, nullCount);
  
        //check if parameters type (using setXXX) have change since previous request, and resend new header type if so
        boolean mustSendHeaderType = false;
        if (parameterTypeHeader[0] == null) {
          mustSendHeaderType = true;
        } else {
          for (int i = 0; i < parameterCount; i++) {
            if (!parameterTypeHeader[i].equals(parameters[i].getColumnType())) {
              mustSendHeaderType = true;
              break;
            }
          }
        }
  
        if (mustSendHeaderType) {
          pos.write((byte) 0x01);
          //Store types of parameters in first in first package that is sent to the server.
          for (int i = 0; i < parameterCount; i++) {
            parameterTypeHeader[i] = parameters[i].getColumnType();
            pos.writeShort(parameterTypeHeader[i].getType());
          }
        } else {
          pos.write((byte) 0x00);
        }
      }
  
      for (int i = 0; i < parameterCount; i++) {
        ParameterHolder holder = parameters[i];
        if (!holder.isNullData() && !holder.isLongData()) {
          holder.writeBinary(pos);
        }
      }
    }