C# Class NetworkCommsDotNet.DPSBase.DataPadder

Inheritance: DataProcessor
Exibir arquivo Open project: MarcFletcher/NetworkComms.Net

Public Methods

Method Description
AddPaddingOptions ( string>.Dictionary options, int paddedSize, DataPaddingType paddingType = DataPaddingType.Zero, bool throwExceptionOnNotEnoughPadding = true ) : void

Adds the necessary options for padding

ForwardProcessDataStream ( Stream inStream, Stream outStream, string>.Dictionary options, long &writtenBytes ) : void
ReverseProcessDataStream ( Stream inStream, Stream outStream, string>.Dictionary options, long &writtenBytes ) : void

Private Methods

Method Description
DataPadder ( ) : System

Method Details

AddPaddingOptions() public static method

Adds the necessary options for padding
public static AddPaddingOptions ( string>.Dictionary options, int paddedSize, DataPaddingType paddingType = DataPaddingType.Zero, bool throwExceptionOnNotEnoughPadding = true ) : void
options string>.Dictionary The Dictionary to add the options to
paddedSize int The size that the data section of the packet should be padded to. If throwExceptionOnNotEnoughPadding is true this must be at least the original data packet size plus four bytes
paddingType DataPaddingType Determines whether the data is padded with zeros or random data
throwExceptionOnNotEnoughPadding bool If true an is thrown if paddingSize is smaller than the original data packet size plus four bytes
return void

ForwardProcessDataStream() public method

public ForwardProcessDataStream ( Stream inStream, Stream outStream, string>.Dictionary options, long &writtenBytes ) : void
inStream Stream
outStream Stream
options string>.Dictionary
writtenBytes long
return void

ReverseProcessDataStream() public method

public ReverseProcessDataStream ( Stream inStream, Stream outStream, string>.Dictionary options, long &writtenBytes ) : void
inStream Stream
outStream Stream
options string>.Dictionary
writtenBytes long
return void