docs: public void writeBind(Bind bind, String portal, List<Object> paramValues) {
      ensureBuffer();
      int pos = out.writerIndex();
      out.writeByte(BIND);
      out.writeInt(0);
      if (portal != null) {
        out.writeCharSequence(portal, StandardCharsets.UTF_8);
      }
      out.writeByte(0);
      if (bind.statement == 0) {
        out.writeByte(0);
      } else {
        out.writeLong(bind.statement);
      }
      int paramLen = paramValues.size();
      out.writeShort(paramLen);
      // Parameter formats
      for (int c = 0;c < paramLen;c++) {
        // for now each format is Binary
        out.writeShort(bind.paramTypes[c].supportsBinary ? 1 : 0);
      }
      out.writeShort(paramLen);
      for (int c = 0;c < paramLen;c++) {
        Object param = paramValues.get(c);
        if (param == null) {
          // NULL value
          out.writeInt(-1);
        } else {
          DataType dataType = bind.paramTypes[c];
          if (dataType.supportsBinary) {
            int idx = out.writerIndex();
            out.writeInt(0);
            DataTypeCodec.encodeBinary(dataType, param, out);
            out.setInt(idx, out.writerIndex() - idx - 4);
          } else {
            DataTypeCodec.encodeText(dataType, param, out);
          }
        }
      }
  
      // MAKE resultColumsn non null to avoid null check
  
      // Result columns are all in Binary format
      if (bind.resultColumns.length > 0) {
        out.writeShort(bind.resultColumns.length);
        for (ColumnDesc resultColumn : bind.resultColumns) {
          out.writeShort(resultColumn.getDataType().supportsBinary ? 1 : 0);
        }
      } else {
        out.writeShort(1);
        out.writeShort(1);
      }
      out.setInt(pos + 1, out.writerIndex() - pos - 1);
    }