Parse the raw data.

@return parsed media information
428806
MediaInfo parse() {
        try {
            BufferedReader reader = new BufferedReader(new StringReader(data));
            MediaInfo mediaInfo = new MediaInfo();
            String sectionName;
            String line;
            Sections sections;
            Section section = null;
            while (parseState != ParseState.FINISHED) {
                switch (parseState) {
                    case DEFAULT:
                        parseState = ParseState.NEXT_SECTION;
                        break;
                    case NEXT_SECTION:
                        sectionName = reader.readLine();
                        if (sectionName == null) {
                            parseState = ParseState.FINISHED;
                        }
                        else if (sectionName.length() > 0) {
                            parseState = ParseState.SECTION;
                            sections = mediaInfo.sections(sectionName);
                            section = sections.newSection();
                        }
                        break;
                    case SECTION:
                        line = reader.readLine();
                        if (line == null) {
                            parseState = ParseState.FINISHED;
                        }
                        else if (line.length() == 0) {
                            parseState = ParseState.NEXT_SECTION;
                        }
                        else {
                            String[] values = line.split(":", 2);
                            section.put(values[0].trim(), values[1].trim());
                        }
                        break;
                    default:
                        throw new IllegalStateException();
                }
            }
            return mediaInfo;
        }
        catch (IOException e) {
            throw new MediaInfoParseException("Failed to parse media info", e);
        }
    }
1267201
public function parse(array $data, ParsingDispatcher $parsingDispatcher)
    {
        $states = array();
        foreach ($data['ObjectState'] as $rawStateData) {
            $states[] = $parsingDispatcher->parse(
                $rawStateData,
                $rawStateData['_media-type']
            );
        }

        return $states;
    }
574227
public function parse(array $data, ParsingDispatcher $parsingDispatcher)
    {
        $contentTypeGroups = array();
        foreach ($data['ContentTypeGroup'] as $rawContentTypeGroupData) {
            $contentTypeGroups[] = $parsingDispatcher->parse(
                $rawContentTypeGroupData,
                $rawContentTypeGroupData['_media-type']
            );
        }

        return $contentTypeGroups;
    }
140426
public function parse() {

		$lines = str_getcsv($this->source, $this->newline, $this->enclosure, $this->escape);

		// add keys from headline if available
		if ($this->getSourceHasHeadline()) {
			$keys = explode($this->delimiter, $lines[0]);
			$this->addKeys($keys);
			unset($lines[0]);
		}

		foreach ($lines as $line) { // iterate over all lines
			
			$values = str_getcsv($line, $this->delimiter, $this->enclosure, $this->escape); // save values in an array
			
			
			foreach ($values as $key => $value) {
				/* remove the escape character, because PHP doesn't do it
				 * https://bugs.php.net/bug.php?id=55413
				 */
				$values[$key] = str_replace($this->escape.$this->enclosure, $this->enclosure, $value);
				// trim all values if trimming is enabled
				if ($this->trim) {
					$values[$key] = trim($values[$key]);
				}
			}
			
			$dataset = array(); // create dataset
			foreach ($values as $position => $rawValue) { // iterate over all values
				$key = isset($this->keys[$position]) ? $this->keys[$position] : $position; // use the property number or a given key as index
				
				$processedValue = $rawValue;

				if (isset($this->modifiers[$key])) { // if there are registered modifiers for that key, let them do their work
					foreach ((array)$this->modifiers[$key] as $modifier) {
						$processedValue = call_user_func($modifier, $processedValue);
					}
				}
				
				$dataset[$key] = $processedValue;
			}

			$this->result[] = $dataset; // add dataset to the final result

		}
		return $this->result;
	}
943262
public String getRawData() {
		if (rawData == null) {
			rawData = com.jfinal.kit.HttpKit.readData(request);
		}
		return rawData;
	}
1077397
public byte[] getContents() {

        byte[] contents = new byte[m_buffer.size()];
        m_buffer.readBytes(contents, 0, 0, m_buffer.size());
        return contents;
    }
445124
public function getData()
    {
        $fp = $this->getStream();
        $data = '';

        while (feof($fp) === false) {
            $data .= fread($fp, self::CHUNK_SIZE);
        }

        @fclose($fp);

        return $data;
    }
164807
protected function parseBody(): array
    {
        if ($this->getRequest()->headers->get('Content-Type') === 'application/json') {
            $dataCollection = json_decode($this->getRequest()->getContent(), true);
        } else {
            if ($this->getRequest()->isMethod('POST')) {
                $dataCollection = array_merge(
                    $this->getRequest()->request->all(),
                    $this->getRequest()->files->all()
                );
            } else {
                parse_str($this->getRequest()->getContent(), $dataCollection);
            }
        }

        return $dataCollection;
    }
43962
protected function parseDataFromResponse()
    {
        $xml = new \SimpleXMLElement($this->rawResponse->body);
        $encodingType = isset($xml->EncodingType) ? strval($xml->EncodingType) : "";
        $objectList = $this->parseObjectList($xml, $encodingType);
        $prefixList = $this->parsePrefixList($xml, $encodingType);
        $bucketName = isset($xml->Name) ? strval($xml->Name) : "";
        $prefix = isset($xml->Prefix) ? strval($xml->Prefix) : "";
        $prefix = OssUtil::decodeKey($prefix, $encodingType);
        $marker = isset($xml->Marker) ? strval($xml->Marker) : "";
        $marker = OssUtil::decodeKey($marker, $encodingType);
        $maxKeys = isset($xml->MaxKeys) ? intval($xml->MaxKeys) : 0;
        $delimiter = isset($xml->Delimiter) ? strval($xml->Delimiter) : "";
        $delimiter = OssUtil::decodeKey($delimiter, $encodingType);
        $isTruncated = isset($xml->IsTruncated) ? strval($xml->IsTruncated) : "";
        $nextMarker = isset($xml->NextMarker) ? strval($xml->NextMarker) : "";
        $nextMarker = OssUtil::decodeKey($nextMarker, $encodingType);
        return new ObjectListInfo($bucketName, $prefix, $marker, $nextMarker, $maxKeys, $delimiter, $isTruncated, $objectList, $prefixList);
    }
1260155
@SuppressWarnings("PMD.AvoidInstantiatingObjectsInLoops")
    private static SortedSet<MediaType> parse(final String text) {
        final SortedSet<MediaType> list = new TreeSet<>();
        for (final String name
            : new EnglishLowerCase(text).string().split(",")) {
            if (!name.isEmpty()) {
                list.add(new MediaType(name));
            }
        }
        return list;
    }
425762
public function parse()
	{
		if ($this->compressed_size >= $this->min_compressed_size)
		{
			// Check ID1, ID2, and CM
			if (substr($this->compressed_data, 0, 3) !== "\x1F\x8B\x08")
			{
				return false;
			}

			// Get the FLG (FLaGs)
			$this->flags = ord($this->compressed_data[3]);

			// FLG bits above (1 << 4) are reserved
			if ($this->flags > 0x1F)
			{
				return false;
			}

			// Advance the pointer after the above
			$this->position += 4;

			// MTIME
			$mtime = substr($this->compressed_data, $this->position, 4);
			// Reverse the string if we're on a big-endian arch because l is the only signed long and is machine endianness
			if (current(unpack('S', "\x00\x01")) === 1)
			{
				$mtime = strrev($mtime);
			}
			$this->MTIME = current(unpack('l', $mtime));
			$this->position += 4;

			// Get the XFL (eXtra FLags)
			$this->XFL = ord($this->compressed_data[$this->position++]);

			// Get the OS (Operating System)
			$this->OS = ord($this->compressed_data[$this->position++]);

			// Parse the FEXTRA
			if ($this->flags & 4)
			{
				// Read subfield IDs
				$this->SI1 = $this->compressed_data[$this->position++];
				$this->SI2 = $this->compressed_data[$this->position++];

				// SI2 set to zero is reserved for future use
				if ($this->SI2 === "\x00")
				{
					return false;
				}

				// Get the length of the extra field
				$len = current(unpack('v', substr($this->compressed_data, $this->position, 2)));
				$this->position += 2;

				// Check the length of the string is still valid
				$this->min_compressed_size += $len + 4;
				if ($this->compressed_size >= $this->min_compressed_size)
				{
					// Set the extra field to the given data
					$this->extra_field = substr($this->compressed_data, $this->position, $len);
					$this->position += $len;
				}
				else
				{
					return false;
				}
			}

			// Parse the FNAME
			if ($this->flags & 8)
			{
				// Get the length of the filename
				$len = strcspn($this->compressed_data, "\x00", $this->position);

				// Check the length of the string is still valid
				$this->min_compressed_size += $len + 1;
				if ($this->compressed_size >= $this->min_compressed_size)
				{
					// Set the original filename to the given string
					$this->filename = substr($this->compressed_data, $this->position, $len);
					$this->position += $len + 1;
				}
				else
				{
					return false;
				}
			}

			// Parse the FCOMMENT
			if ($this->flags & 16)
			{
				// Get the length of the comment
				$len = strcspn($this->compressed_data, "\x00", $this->position);

				// Check the length of the string is still valid
				$this->min_compressed_size += $len + 1;
				if ($this->compressed_size >= $this->min_compressed_size)
				{
					// Set the original comment to the given string
					$this->comment = substr($this->compressed_data, $this->position, $len);
					$this->position += $len + 1;
				}
				else
				{
					return false;
				}
			}

			// Parse the FHCRC
			if ($this->flags & 2)
			{
				// Check the length of the string is still valid
				$this->min_compressed_size += $len + 2;
				if ($this->compressed_size >= $this->min_compressed_size)
				{
					// Read the CRC
					$crc = current(unpack('v', substr($this->compressed_data, $this->position, 2)));

					// Check the CRC matches
					if ((crc32(substr($this->compressed_data, 0, $this->position)) & 0xFFFF) === $crc)
					{
						$this->position += 2;
					}
					else
					{
						return false;
					}
				}
				else
				{
					return false;
				}
			}

			// Decompress the actual data
			if (($this->data = gzinflate(substr($this->compressed_data, $this->position, -8))) === false)
			{
				return false;
			}
			else
			{
				$this->position = $this->compressed_size - 8;
			}

			// Check CRC of data
			$crc = current(unpack('V', substr($this->compressed_data, $this->position, 4)));
			$this->position += 4;
			/*if (extension_loaded('hash') && sprintf('%u', current(unpack('V', hash('crc32b', $this->data)))) !== sprintf('%u', $crc))
			{
				return false;
			}*/

			// Check ISIZE of data
			$isize = current(unpack('V', substr($this->compressed_data, $this->position, 4)));
			$this->position += 4;
			if (sprintf('%u', strlen($this->data) & 0xFFFFFFFF) !== sprintf('%u', $isize))
			{
				return false;
			}

			// Wow, against all odds, we've actually got a valid gzip string
			return true;
		}
		else
		{
			return false;
		}
	}
711211
public function parse()
	{
		while ($this->state && $this->state !== 'emit' && $this->has_data())
		{
			$state = $this->state;
			$this->$state();
		}
		$this->data = '';
		if ($this->state === 'emit' || $this->state === 'body')
		{
			return true;
		}

		$this->http_version = '';
		$this->status_code = '';
		$this->reason = '';
		$this->headers = array();
		$this->body = '';
		return false;
	}
700610
private void parse()
    {
        this.elements = new ArrayList<>();

        try {
            for (Tokenizer tokenizer = new Tokenizer(this.rawVersion); tokenizer.next();) {
                Element element = new Element(tokenizer);
                this.elements.add(element);
                if (element.getVersionType() != Type.STABLE) {
                    this.type = element.getVersionType();
                }
            }

            trimPadding(this.elements);
        } catch (Exception e) {
            // Make sure to never fail no matter what
            LOGGER.error("Failed to parse version [" + this.rawVersion + "]", e);
            this.elements.add(new Element(this.rawVersion));
        }
    }
544751
public function parse(array $data, ParsingDispatcher $parsingDispatcher)
    {
        $contentTypes = array();
        foreach ($data['ContentType'] as $rawContentTypeData) {
            $contentTypes[] = $parsingDispatcher->parse(
                $rawContentTypeData,
                $rawContentTypeData['_media-type']
            );
        }

        return $contentTypes;
    }
449784
def parse(self, raw):
        """"""
        self._raw = raw
        self.hub_name = self._parse("userData", "hubName", converter=base64_to_unicode)
        self.ip = self._parse("userData", "ip")
        self.ssid = self._parse("userData", "ssid")
477991
public function parse()
    {
        $matches = [];
        preg_match_all('@url\((.*)\)->find\(([-\.#\w]+)\)(?:->filter\(([-\.#\w]+)(?:,(.+))?\))?@', $this->get(), $matches);

        $this->url = $this->getOption('urlPrefix');
        if (!empty($matches[1][0])) {
            $this->url .= trim($matches[1][0], ' \'"');
        }
        if (!empty($matches[2][0])) {
            $this->selector = trim($matches[2][0], ' \'"');
        }
        if (!empty($matches[3][0])) {
            $this->filter->selector = trim($matches[3][0], ' \'"');
        }
        if (!empty($matches[4][0])) {
            $this->filter->length = (int) trim($matches[4][0]);
        }

        return $this;
    }
980039
public function parse()
    {
        $result = [];

        $result['status'] = $this->service->getStatusCode();
        $this->setLogs($result['status'], 'status');

        // Format the head response.
        $result['headers'] = $this->service->getHeaders();
        if ($result['headers']) {
            $result['headers'] = $this->getResponseArray($result['headers'], 'headers');
        }
        $result['headersRaw'] = implode('; ', $result['headers']);
        $this->setLogs($result['headers'], 'headers');

        $result['bodySize'] = $this->service->getBody()->getSize();
        $this->setLogs($result['bodySize'], 'size');

        $result['bodyRaw'] = $this->service->getBody()->getContents();
        $this->setLogs($result['bodyRaw'], 'bodyRaw');

        // Format the body response.
        $responseExpectedFormat = trim(
            strtolower(isset($this->responseExpected->format) ? $this->responseExpected->format : 'auto')
        );
        // Move the expected format to the top of the detection array.
        if ('auto' !== $responseExpectedFormat) {
            $key = array_search($responseExpectedFormat, $this->contentTypes);
            if (false !== $key) {
                $this->contentTypes = array_flip(
                    array_merge([$this->contentTypes[$key] => '-'], array_flip($this->contentTypes))
                );
            }
        }
        $this->setLogs($responseExpectedFormat, 'format');
        $result['format'] = $responseExpectedFormat;

        // If auto mode, discern content type in a very forgiving manner from the header.
        if ('auto' === $result['format']) {
            foreach ($result['headers'] as $keaderType => $header) {
                if ('contenttype' === str_replace(['-', '_', ' '], '', strtolower($keaderType))) {
                    foreach ($this->contentTypes as $key => $contentType) {
                        if (strpos(strtolower($header), $contentType)) {
                            $result['format'] = $contentType;
                            // Move this type to the top of the detection array.
                            $this->contentTypes = array_flip(
                                array_merge([$this->contentTypes[$key] => '-'], array_flip($this->contentTypes))
                            );
                            $this->setLogs($contentType, 'headerFormat');
                            break;
                        }
                    }
                    break;
                }
            }
        }

        $result['body'] = [];
        // Attempt to parse with a proffered list of types.
        foreach ($this->contentTypes as $contentType) {
            $attemptBody = $this->getResponseArray($result['bodyRaw'], $contentType);
            if ($attemptBody) {
                $result['body']   = $attemptBody;
                $result['format'] = $contentType;
                $this->setLogs($contentType, 'bodyFormat');
                break;
            }
            $this->setLogs($contentType, 'bodyFormatsAttempted');
            // If in test-mode do not cycle through all types unless we are truly in auto mode.
            if (!$this->test && 'auto' === $responseExpectedFormat) {
                break;
            }
        }
        $this->setLogs($result['body'], 'body');

        $this->valid          = (bool) $result['status'];
        $this->responseActual = $result;

        return $this;
    }