TwitterOAuth\Auth\AuthAbstract::getBinaryFile PHP Method

getBinaryFile() protected method

Get binary data of a file
protected getBinaryFile ( string $filename ) : string
$filename string File location
return string
    protected function getBinaryFile($filename)
    {
        if (!file_exists($filename)) {
            throw new FileNotFoundException();
        }
        if (!is_readable($filename)) {
            throw new FileNotReadableException();
        }
        ob_start();
        readfile($filename);
        $binary = ob_get_contents();
        ob_end_clean();
        unset($filename);
        return $binary;
    }