C# 클래스 Journaler.FileBlockWriter

상속: IBlockWriter
파일 보기 프로젝트 열기: odeheurles/Journaler-net

공개 메소드들

메소드 설명
Dispose ( ) : void

Dispose the instance

FileBlockWriter ( string path, int blockSizeInBytes ) : System

Create a new FileBlockWriter

SetSize ( int blocksCount ) : void

Pre-allocates the file on disk with the given size. This improves speed compared to a fragmented file.

Write ( byte block, bool moveToNextBlock ) : void

Write a block to disk and move to next block if specified

비공개 메소드들

메소드 설명
CreateFile ( String fileName, int desiredAccess, FileShare shareMode, IntPtr securityAttrs, FileMode creationDisposition, int flagsAndAttributes, IntPtr templateFile ) : SafeFileHandle
GetDiskFreeSpace ( string path, uint &sectorsPerCluster, uint &bytesPerSector, uint &numberOfFreeClusters, uint &totalNumberOfClusters ) : bool
GetDriveSectorSize ( string path ) : uint

Return the sector size of the volume the specified filepath lives on.

OpenStream ( string path, FileMode mode, FileAccess acc, FileShare share, bool sequential, bool useAsync, int blockSize ) : FileStream

메소드 상세

Dispose() 공개 메소드

Dispose the instance
public Dispose ( ) : void
리턴 void

FileBlockWriter() 공개 메소드

Create a new FileBlockWriter
If blockSizeInBytes is smaller or equal to 0. if path is null or empty or if blockSize is not a multiple of the disk sector size.
public FileBlockWriter ( string path, int blockSizeInBytes ) : System
path string full path of the new file.
blockSizeInBytes int size of the blocks in bytes
리턴 System

SetSize() 공개 메소드

Pre-allocates the file on disk with the given size. This improves speed compared to a fragmented file.
public SetSize ( int blocksCount ) : void
blocksCount int Size of the files in number of blocks (size of the file is blockCount * blockSize)
리턴 void

Write() 공개 메소드

Write a block to disk and move to next block if specified
public Write ( byte block, bool moveToNextBlock ) : void
block byte The block to write to disk
moveToNextBlock bool True to move to the next block, False otherwise.
리턴 void