docs: private static int getSize(Object[] data, int l, Type[] types) {
  
          int s = 0;
  
          for (int i = 0; i < l; i++) {
              Object o = data[i];
  
              s += 1;    // type or null
  
              if (o != null) {
                  switch (types[i].typeCode) {
  
                      case Types.SQL_ALL_TYPES :
                          throw Error.runtimeError(ErrorCode.U_S0500,
                                                   "RowOutputBinary");
                      case Types.SQL_CHAR :
                      case Types.SQL_VARCHAR :
                      case Types.VARCHAR_IGNORECASE :
                          s += 4;
                          s += StringConverter.getUTFSize((String) o);
                          break;
  
                      case Types.TINYINT :
                      case Types.SQL_SMALLINT :
                          s += 2;
                          break;
  
                      case Types.SQL_INTEGER :
                          s += 4;
                          break;
  
                      case Types.SQL_BIGINT :
                      case Types.SQL_REAL :
                      case Types.SQL_FLOAT :
                      case Types.SQL_DOUBLE :
                          s += 8;
                          break;
  
                      case Types.SQL_NUMERIC :
                      case Types.SQL_DECIMAL :
                          s += 8;
  
                          BigDecimal bigdecimal = (BigDecimal) o;
                          BigInteger bigint =
                              JavaSystem.unscaledValue(bigdecimal);
  
                          s += bigint.toByteArray().length;
                          break;
  
                      case Types.SQL_BOOLEAN :
                          s += 1;
                          break;
  
                      case Types.SQL_DATE :
                          s += 8;
                          break;
  
                      case Types.SQL_TIME :
                          s += 8;
                          break;
  
                      case Types.SQL_TIME_WITH_TIME_ZONE :
                          s += 12;
                          break;
  
                      case Types.SQL_TIMESTAMP :
                          s += 12;
                          break;
  
                      case Types.SQL_TIMESTAMP_WITH_TIME_ZONE :
                          s += 16;
                          break;
  
                      case Types.SQL_INTERVAL_YEAR :
                      case Types.SQL_INTERVAL_YEAR_TO_MONTH :
                      case Types.SQL_INTERVAL_MONTH :
                          s += 8;
                          break;
  
                      case Types.SQL_INTERVAL_DAY :
                      case Types.SQL_INTERVAL_DAY_TO_HOUR :
                      case Types.SQL_INTERVAL_DAY_TO_MINUTE :
                      case Types.SQL_INTERVAL_DAY_TO_SECOND :
                      case Types.SQL_INTERVAL_HOUR :
                      case Types.SQL_INTERVAL_HOUR_TO_MINUTE :
                      case Types.SQL_INTERVAL_HOUR_TO_SECOND :
                      case Types.SQL_INTERVAL_MINUTE :
                      case Types.SQL_INTERVAL_MINUTE_TO_SECOND :
                      case Types.SQL_INTERVAL_SECOND :
                          s += 12;
                          break;
  
                      case Types.SQL_BINARY :
                      case Types.SQL_VARBINARY :
                          s += 4;
                          s += ((BinaryData) o).length(null);
                          break;
  
                      case Types.SQL_BIT :
                      case Types.SQL_BIT_VARYING :
                          s += 4;
                          s += ((BinaryData) o).length(null);
                          break;
  
                      case Types.SQL_CLOB :
                      case Types.SQL_BLOB :
                          s += 8;
                          break;
  
                      case Types.OTHER :
                          JavaObjectData jo = (JavaObjectData) o;
  
                          s += 4;
                          s += jo.getBytesLength();
                          break;
  
                      default :
                          throw Error.runtimeError(ErrorCode.U_S0500,
                                                   "RowOutputBinary");
                  }
              }
          }
  
          return s;
      }