protected void DecompressTokenSequence(DecompressedBuffer buffer, DecompressionState state, IEnumerable <TokenSequence> tokenSequence) { foreach (var t in tokenSequence) { t.Decompress(buffer, state); } }
public void Decompress(DecompressedBuffer buffer, DecompressionState state) { state.DecompressedChunkStart = state.DecompressedCurrent; //var CompressedEnd = Math.Min(state.CompressionRecordEnd, state.CompressedChunkStart + this.CompressedHeader.CompressedChunkSize); state.CompressedCurrent += 2; this.CompressedData.Decompress(buffer, state); }
public override void Decompress(DecompressedBuffer buffer, DecompressionState state) { var decompressedChunk = new DecompressedChunk(new byte[] { Data }); buffer.Add(decompressedChunk); ++state.DecompressedCurrent; ++state.CompressedCurrent; }
/* * public Byte[] GetDataInRawBytes() * { * IEnumerable<Byte> result = new Byte[] { this.FlagByte }; * foreach(var token in _Tokens) * { * result = result.Concat(token.GetDataInRawBytes()); * } * * return result.ToArray(); * }*/ public void Decompress(DecompressedBuffer buffer, DecompressionState state) { ++state.CompressedCurrent; foreach (var token in this._Tokens) { token.Decompress(buffer, state); } }
public override void Decompress(DecompressedBuffer buffer, DecompressionState state) { var info = UnpackCopyToken(this.Token, state.DecompressedCurrent, state.DecompressedChunkStart); var copySource = state.DecompressedCurrent - info.Offset; // Call Byte Copy (section 2.4.1.3.11) with CopySource, DecompressedCurrent, and Length ByteCopy(buffer, copySource, state.DecompressedCurrent, info.Length); state.DecompressedCurrent += info.Length; state.CompressedCurrent += 2; }
public void DecompressRawChunk(DecompressedBuffer buffer, DecompressionState state, Byte[] Data) { throw new NotImplementedException(); Byte[] append = new Byte[4096]; //Array.Copy(state.OriginalData, state.CompressedCurrent, append, 0, header.CompressedChunkSize); //int nCopy = Math.Min(4096, state.OriginalData.Length-state.CompressedCurrent); //Array.Copy(state.OriginalData, state.CompressedCurrent, append, 0, nCopy); Array.Copy(this.Data, 0, append, 0, 4096); // todo: maybe copy from original data? state.DecompressedCurrent += 4096; state.CompressedCurrent += 4096; var x = new DecompressedChunk(append); buffer.Add(x); }
public void Decompress(DecompressedBuffer buffer) { var state = new DecompressionState(); if (this.SignatureByte == (Byte)0x01) { ++state.CompressedCurrent; foreach (var chunk in _Chunks) { state.CompressedChunkStart = state.CompressedCurrent; chunk.Decompress(buffer, state); } } else { throw new Exception(); } }
public abstract void Decompress(DecompressedBuffer buffer, DecompressionState state);