public static function toProtobuf($object, $filter = NULL)
	{
		$output = '';

		if (isset($object->name) && ($filter === null || isset($filter['name']))) {
			$output .= "\x0a";
			$output .= Binary::encodeVarint(strlen($object->name));
			$output .= $object->name;
		}

		if (isset($object->method) && ($filter === null || isset($filter['method']))) {
			foreach ($object->method instanceof \Traversable ? $object->method : (array)$object->method as $k => $v) {
				$output .= "\x12";
				$buffer = MethodDescriptorProtoMeta::toProtobuf($v, $filter === null ? null : $filter['method']);
				$output .= Binary::encodeVarint(strlen($buffer));
				$output .= $buffer;
			}
		}

		if (isset($object->options) && ($filter === null || isset($filter['options']))) {
			$output .= "\x1a";
			$buffer = ServiceOptionsMeta::toProtobuf($object->options, $filter === null ? null : $filter['options']);
			$output .= Binary::encodeVarint(strlen($buffer));
			$output .= $buffer;
		}

		return $output;
	}