public void SetData(byte[] chunkData, bool compressed, bool chunked) { if (compressed) { ChunkData = ZipUtility.Inflate(chunkData); if (chunked) { _index.ChunkSize = Convert.ToInt16(ChunkData.Length); _index.CompressedChunkSize = Convert.ToInt16(chunkData.Length); } } else { ChunkData = chunkData; if (chunked) { _index.ChunkSize = Convert.ToInt16(chunkData.Length); _index.CompressedChunkSize = Convert.ToInt16(ZipUtility.Deflate(chunkData).Length); } } }
public void WriteData(Stream outputStream) { outputStream.Position = _index.DataOffset; byte[] chunkData = _index.CompressData ? ZipUtility.Deflate(ChunkData) : ChunkData; outputStream.Write(chunkData, 0, chunkData.Length); }