code: public int appendAll(OptionalParameter[] optionalParameters) {
          int length = 0;
          for (OptionalParameter optionalParamameter : optionalParameters) {
              length += append(optionalParamameter);
          }
          return length;
      }
docs: Append all optional parameters.
  
  @param optionalParameters is the optional parameters.
  @return the latest length of the buffer.