protected function readUntil($search)
    {
        while (($position = strpos($this->buffer, $search)) === false) {
            if (feof($this->fp)) {
                fclose($this->fp);
                throw new DecodeException(
                    "Invalid multipart data encountered; " .
                    "end of content was reached before expected"
                );
            }
            $this->buffer .= fread($this->fp, $this->bytesPerRead);
        }
        return $position;
    }
protected function readUntil($search)
    {
        while (($position = strpos($this->buffer, $search)) === false) {
            if (feof($this->fp)) {
                fclose($this->fp);
                throw new DecodeException(
                    "Invalid multipart data encountered; " .
                    "end of content was reached before expected"
                );
            }
            $this->buffer .= fread($this->fp, $this->bytesPerRead);
        }
        return $position;
    }
protected function readUntil ( $ search ) { while ( ( $ position = strpos ( $ this -> buffer , $ search ) ) === false ) { if ( feof ( $ this -> fp ) ) { fclose ( $ this -> fp ) ; throw new DecodeException ( "Invalid multipart data encountered; " . "end of content was reached before expected" ) ; } $ this -> buffer .= fread ( $ this -> fp , $ this -> bytesPerRead ) ; } return $ position ; }
Read the input stream into the buffer until a string is encountered

@param string $search The string to read until
@return int The position of the string in the buffer
@throws DecodeException
Read the input stream into the buffer until a string is encountered