code: boolean tryAdd(TaskMessage taskMsg) {
          if ((encodedLength + msgEncodeLength(taskMsg)) > buffer_size)
              return false;
          add(taskMsg);
          return true;
      }
docs: try to add a TaskMessage to a batch
  
  @param taskMsg task message
  @return false if the msg could not be added due to buffer size limit; true otherwise