C# Class Squared.Data.Mangler.Internal.StreamRef

Inheritance: IDisposable
显示文件 Open project: sq/DataMangler Class Usage Examples

Public Properties

Property Type Description
HeaderSize uint
NativeStream System.IO.FileStream
OwnsStream bool

Protected Properties

Property Type Description
Cache ViewCache
Handle System.IO.MemoryMappedFiles.MemoryMappedFile
HeaderView System.IO.MemoryMappedFiles.MemoryMappedViewAccessor
StreamCapacity long

Public Methods

Method Description
AccessRange ( long offset, uint size, MemoryMappedFileAccess access = MemoryMappedFileAccess.ReadWrite ) : StreamRange

Accesses a range of bytes within the stream.

AccessRangeUncached ( long offset, uint size, MemoryMappedFileAccess access = MemoryMappedFileAccess.ReadWrite ) : StreamRange

Accesses a range of bytes within the stream, bypassing the stream cache.

AllocateSpace ( uint size ) : long?

Allocates size byte(s) of unused space at the end of the stream.

Clear ( ) : void
Dispose ( ) : void
FlushCache ( ) : void
Shrink ( int size ) : long
StreamRef ( FileStream nativeStream, bool ownsStream = true ) : System

Protected Methods

Method Description
CreateHandles ( long capacity ) : void
EnsureCapacity ( long capacity ) : void
GetTotalLength ( ) : long

Private Methods

Method Description
AccessHeader ( ) : StreamHeaderRef
DisposeViews ( ) : void

Method Details

AccessRange() public method

Accesses a range of bytes within the stream.
public AccessRange ( long offset, uint size, MemoryMappedFileAccess access = MemoryMappedFileAccess.ReadWrite ) : StreamRange
offset long The offset within the stream, relative to the end of the stream header.
size uint The size of the range to access, in bytes.
access MemoryMappedFileAccess
return StreamRange

AccessRangeUncached() public method

Accesses a range of bytes within the stream, bypassing the stream cache.
public AccessRangeUncached ( long offset, uint size, MemoryMappedFileAccess access = MemoryMappedFileAccess.ReadWrite ) : StreamRange
offset long The offset within the stream, relative to the end of the stream header.
size uint The size of the range to access, in bytes.
access MemoryMappedFileAccess
return StreamRange

AllocateSpace() public method

Allocates size byte(s) of unused space at the end of the stream.
public AllocateSpace ( uint size ) : long?
size uint The number of bytes to allocate.
return long?

Clear() public method

public Clear ( ) : void
return void

CreateHandles() protected method

protected CreateHandles ( long capacity ) : void
capacity long
return void

Dispose() public method

public Dispose ( ) : void
return void

EnsureCapacity() protected method

protected EnsureCapacity ( long capacity ) : void
capacity long
return void

FlushCache() public method

public FlushCache ( ) : void
return void

GetTotalLength() protected method

protected GetTotalLength ( ) : long
return long

Shrink() public method

public Shrink ( int size ) : long
size int
return long

StreamRef() public method

public StreamRef ( FileStream nativeStream, bool ownsStream = true ) : System
nativeStream System.IO.FileStream
ownsStream bool
return System

Property Details

Cache protected_oe property

protected ViewCache,Squared.Data.Mangler.Internal Cache
return ViewCache

Handle protected_oe property

protected MemoryMappedFile,System.IO.MemoryMappedFiles Handle
return System.IO.MemoryMappedFiles.MemoryMappedFile

HeaderSize public_oe static_oe property

public static uint HeaderSize
return uint

HeaderView protected_oe property

protected MemoryMappedViewAccessor,System.IO.MemoryMappedFiles HeaderView
return System.IO.MemoryMappedFiles.MemoryMappedViewAccessor

NativeStream public_oe property

public FileStream,System.IO NativeStream
return System.IO.FileStream

OwnsStream public_oe property

public bool OwnsStream
return bool

StreamCapacity protected_oe property

protected long StreamCapacity
return long