C# 클래스 DistributedFileSystem.DistributedItemData

파일 보기 프로젝트 열기: MarcFletcher/NetworkComms.Net

Private Properties

프로퍼티 타입 설명
BuildChunkCheckSums void
DistributedItemData NetworkCommsDotNet
InitialiseChunkPositionLengthDict void

공개 메소드들

메소드 설명
CopyTo ( Stream destinationStream ) : void

Copies data specified by start and length properties from internal stream to the provided stream.

Dispose ( bool forceDispose ) : void

Disposes the internal stream. If StreamTools.ThreadSafeStream.DiposeInnerStreamOnDispose is false, forceDispose must be true to dispose of the internal stream.

DistributedItemData ( DataBuildMode dataBuildMode, Stream>.Dictionary itemDataStreams, bool enableChunkChecksum = false ) : NetworkCommsDotNet

Initialise the item data using existing chunk streams. Build mode must be to blocks.

DistributedItemData ( ItemAssemblyConfig assemblyConfig ) : NetworkCommsDotNet

Initialise the item data from an assembly config

DistributedItemData ( string itemIdentifier, DataBuildMode dataBuildMode, Stream itemDataStream, bool enableChunkChecksum = false ) : NetworkCommsDotNet

Initialise the item data using an existing stream. If the build mode is to blocks the itemDataStream is broken into chunks.

GetChunkStream ( int chunkIndex ) : StreamTools.StreamSendWrapper

Return a StreamSendWrapper corresponding with the desired chunk

GetDataAsSingleStream ( ) : StreamTools.ThreadSafeStream

Get a single threadsafe stream containing all item data

MD5 ( ) : string

Return the MD5 of the whole item data

MD5 ( int chunkIndex ) : string

Return the MD5 of the specified chunk

SetData ( string itemIdentifier, Stream itemDataStream ) : void

Sets the item data using the provided data stream. Useful for setting data after deserialisation

ToArray ( ) : byte[]

Returns data for the entire item as byte[]

UpdateBuildTarget ( DataBuildMode newDataBuildMode ) : void

Updates the ItemBuildTarget

Write ( int chunkIndex, byte chunkData ) : void

Writes the provided buffer to the data starting at the provided position within the item data

비공개 메소드들

메소드 설명
BuildChunkCheckSums ( ) : void

Uses the loaded stream and builds individual chunk checksums

DistributedItemData ( ) : NetworkCommsDotNet

Private constructor for deserialisation

InitialiseChunkPositionLengthDict ( ) : void

Calculates the corresponding chunk positions and lengths when this item is deserialised

메소드 상세

CopyTo() 공개 메소드

Copies data specified by start and length properties from internal stream to the provided stream.
public CopyTo ( Stream destinationStream ) : void
destinationStream Stream The destination stream for the item data
리턴 void

Dispose() 공개 메소드

Disposes the internal stream. If StreamTools.ThreadSafeStream.DiposeInnerStreamOnDispose is false, forceDispose must be true to dispose of the internal stream.
public Dispose ( bool forceDispose ) : void
forceDispose bool If true the internal stream will be disposed regardless of value.
리턴 void

DistributedItemData() 공개 메소드

Initialise the item data using existing chunk streams. Build mode must be to blocks.
public DistributedItemData ( DataBuildMode dataBuildMode, Stream>.Dictionary itemDataStreams, bool enableChunkChecksum = false ) : NetworkCommsDotNet
dataBuildMode DataBuildMode
itemDataStreams Stream>.Dictionary
enableChunkChecksum bool
리턴 NetworkCommsDotNet

DistributedItemData() 공개 메소드

Initialise the item data from an assembly config
public DistributedItemData ( ItemAssemblyConfig assemblyConfig ) : NetworkCommsDotNet
assemblyConfig ItemAssemblyConfig
리턴 NetworkCommsDotNet

DistributedItemData() 공개 메소드

Initialise the item data using an existing stream. If the build mode is to blocks the itemDataStream is broken into chunks.
public DistributedItemData ( string itemIdentifier, DataBuildMode dataBuildMode, Stream itemDataStream, bool enableChunkChecksum = false ) : NetworkCommsDotNet
itemIdentifier string
dataBuildMode DataBuildMode
itemDataStream Stream
enableChunkChecksum bool
리턴 NetworkCommsDotNet

GetChunkStream() 공개 메소드

Return a StreamSendWrapper corresponding with the desired chunk
public GetChunkStream ( int chunkIndex ) : StreamTools.StreamSendWrapper
chunkIndex int
리턴 NetworkCommsDotNet.Tools.StreamTools.StreamSendWrapper

GetDataAsSingleStream() 공개 메소드

Get a single threadsafe stream containing all item data
public GetDataAsSingleStream ( ) : StreamTools.ThreadSafeStream
리턴 NetworkCommsDotNet.Tools.StreamTools.ThreadSafeStream

MD5() 공개 메소드

Return the MD5 of the whole item data
public MD5 ( ) : string
리턴 string

MD5() 공개 메소드

Return the MD5 of the specified chunk
public MD5 ( int chunkIndex ) : string
chunkIndex int
리턴 string

SetData() 공개 메소드

Sets the item data using the provided data stream. Useful for setting data after deserialisation
public SetData ( string itemIdentifier, Stream itemDataStream ) : void
itemIdentifier string
itemDataStream Stream
리턴 void

ToArray() 공개 메소드

Returns data for the entire item as byte[]
public ToArray ( ) : byte[]
리턴 byte[]

UpdateBuildTarget() 공개 메소드

Updates the ItemBuildTarget
public UpdateBuildTarget ( DataBuildMode newDataBuildMode ) : void
newDataBuildMode DataBuildMode The new DataBuildMode to use
리턴 void

Write() 공개 메소드

Writes the provided buffer to the data starting at the provided position within the item data
public Write ( int chunkIndex, byte chunkData ) : void
chunkIndex int
chunkData byte
리턴 void