public function deserialize()
    {
        do {
            $lengthString = stream_get_line($this->_inputStream, 100, "\n");
        } while (
            empty($lengthString) || $lengthString == "\n" || $lengthString == "\r"
        );

        $intLengthString = hexdec(trim($lengthString));

        $chunkData = stream_get_contents($this->_inputStream, $intLengthString);
        $goalState = $this->_deserializer->deserialize($chunkData);

        return $goalState;
    }