code: 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;
      }
docs: Get binary data of a file
  
  @param string $filename File location
  @return string
  @throws FileNotFoundException
  @throws FileNotReadableException