helpers/class.Utils.php
static public function qtiFileToString(QtiFile $file) {
        $string = '';
        $filename = $file->getFilename();
        $mimetype = $file->getMimeType();
        $filenameLen = strlen($filename);
        $mimetypeLen = strlen($mimetype);
        
        $string .= pack('S', $filenameLen);
        $string .= $filename;
        
        $string .= pack('S', $mimetypeLen);
        $string .= $mimetype;
        
        // Avoid invalid data for serialize
        // (This could make me cry...)
        $string .= $file->getData();
        return $string;
    }
static public function qtiFileToString(QtiFile $file) {
        $string = '';
        $filename = $file->getFilename();
        $mimetype = $file->getMimeType();
        $filenameLen = strlen($filename);
        $mimetypeLen = strlen($mimetype);
        
        $string .= pack('S', $filenameLen);
        $string .= $filename;
        
        $string .= pack('S', $mimetypeLen);
        $string .= $mimetype;
        
        // Avoid invalid data for serialize
        // (This could make me cry...)
        $string .= $file->getData();
        return $string;
    }
Marshall a QTI File datatype into a binary string. The resulting binary string constitution
is the following:

* The length of the file name, unsigned short.
* The file name, string.
* The length of the mime type, unsigned short.
* The mime type, string.
* The binary content of the file, string.

@param File $file
@return string