public StreamAsyncProcessor(StreamAlgorithm algorithm) { _algorithm = algorithm; for (int i = 0; i < 9; ++i) { _unitPool.Add(new StreamUnit(algorithm)); } }
public static IStreamAlgorithm CreateAlgorithm(StreamAlgorithm algorithm) { if (algorithm == StreamAlgorithm.GZip) { return(new GZipAlgorithm()); } return(new NoZipAlgorithm()); }
public OCStreamer(bool multiThread = false, StreamAlgorithm algorithm = StreamAlgorithm.GZip) { _algorithm = algorithm; if (multiThread) { _streamProcessor = new StreamAsyncProcessor(algorithm); } else { _streamProcessor = new StreamSyncProcessor(algorithm); } }
public StreamSyncProcessor(StreamAlgorithm algorithm) { _streamUnit = new StreamUnit(algorithm); }
public StreamUnit(StreamAlgorithm algorithm) { _algorithm = StreamAlgorithmFactory.CreateAlgorithm(algorithm); _stats = new StreamStats(algorithm); Busy = false; }
public StreamStats(StreamAlgorithm algorithm) { Algorithm = algorithm; CompressTime = 0; DecompressTime = 0; }