Provides a in memory stream that uses pages that are pooled in the unmanaged buffer pool.
Наследование: GSF.IO.Unmanaged.MemoryPoolStreamCore, IDiskMediumCoreFunctions
Пример #1
0
        /// <summary>
        /// Creates a <see cref="DiskMedium"/> that is entirely based in memory.
        /// </summary>
        /// <param name="pool">the <see cref="MemoryPool"/> to allocate data from</param>
        /// <param name="fileStructureBlockSize">the block size of the file structure. Usually 4kb.</param>
        /// <param name="flags">Flags to write to the file</param>
        /// <returns></returns>
        public static DiskMedium CreateMemoryFile(MemoryPool pool, int fileStructureBlockSize, params Guid[] flags)
        {
            FileHeaderBlock header = FileHeaderBlock.CreateNew(fileStructureBlockSize, flags);
            MemoryPoolFile  disk   = new MemoryPoolFile(pool);

            return(new DiskMedium(disk, header));
        }
 /// <summary>
 /// Creates a new <see cref="IoSession"/>
 /// </summary>
 /// <param name="file">the base file</param>
 public IoSession(MemoryPoolFile file)
 {
     m_file = file;
 }
 /// <summary>
 /// Creates a <see cref="DiskMedium"/> that is entirely based in memory.
 /// </summary>
 /// <param name="pool">the <see cref="MemoryPool"/> to allocate data from</param>
 /// <param name="fileStructureBlockSize">the block size of the file structure. Usually 4kb.</param>
 /// <param name="flags">Flags to write to the file</param>
 /// <returns></returns>
 public static DiskMedium CreateMemoryFile(MemoryPool pool, int fileStructureBlockSize, params Guid[] flags)
 {
     FileHeaderBlock header = FileHeaderBlock.CreateNew(fileStructureBlockSize, flags);
     MemoryPoolFile disk = new MemoryPoolFile(pool);
     return new DiskMedium(disk, header);
 }
Пример #4
0
 /// <summary>
 /// Creates a new <see cref="IoSession"/>
 /// </summary>
 /// <param name="file">the base file</param>
 public IoSession(MemoryPoolFile file)
 {
     m_file = file;
 }