Beispiel #1
0
 private Stream CreateStorageStream()
 {
     if (!ES2DirectoryUtility.Exists(settings.filenameData.directoryPath))
     {
         ES2DirectoryUtility.CreateDirectory(settings.filenameData.directoryPath);
     }
     return(ES2FileUtility.CreateFileStream(settings.filenameData.filePath, settings.fileMode, settings.bufferSize));
 }
Beispiel #2
0
 private Stream CreateReadStream()
 {
     if (settings.optimizeMode == ES2Settings.OptimizeMode.Fast)
     {
         return(new MemoryStream(ES2FileUtility.ReadAllBytes(settings.filenameData.filePath)));
     }
     else
     {
         return(ES2FileUtility.CreateFileStream(settings.filenameData.filePath, ES2Settings.ES2FileMode.Open, settings.bufferSize));
     }
 }
Beispiel #3
0
    private Stream CreateWriteStream()
    {
        if (settings.optimizeMode == ES2Settings.OptimizeMode.Fast)
        {
            return(new MemoryStream());
        }
        else
        {
            if (!ES2DirectoryUtility.Exists(settings.filenameData.directoryPath))
            {
                ES2DirectoryUtility.CreateDirectory(settings.filenameData.directoryPath);
            }

            return(ES2FileUtility.CreateFileStream(settings.filenameData.filePath + "tmp", ES2Settings.ES2FileMode.Create, settings.bufferSize));
        }
    }