OpenFile() public static method

Creates a DiskMedium from a stream. This will read the existing header from the stream.
public static OpenFile ( CustomFileStream stream, MemoryPool pool, int fileStructureBlockSize ) : DiskMedium
stream CustomFileStream An open to use. The /// will assume ownership of this .
pool GSF.IO.Unmanaged.MemoryPool The to allocate data from.
fileStructureBlockSize int the block size of the file structure. Usually 4kb.
return DiskMedium
Esempio n. 1
0
        public static DiskIo OpenFile(string fileName, MemoryPool pool, bool isReadOnly)
        {
            CustomFileStream fileStream = CustomFileStream.OpenFile(fileName, pool.PageSize, out int fileStructureBlockSize, isReadOnly, true);
            DiskMedium       disk       = DiskMedium.OpenFile(fileStream, pool, fileStructureBlockSize);

            return(new DiskIo(disk, isReadOnly));
        }