public function serializeToString() {
    $uninitialized = $this->checkInitialized();
    if ($uninitialized !== null) {
      throw new ProtocolBufferEncodeError(
        "Not initialized: " . $uninitialized);
    }
    return $this->serializePartialToString();
  }