internal CompressedChunk(DecompressedChunk decompressedChunk) { // Contract.Requires<ArgumentNullException>(decompressedChunk != null); // Contract.Ensures(Header != null); // Contract.Ensures(ChunkData != null); ChunkData = new CompressedChunkData(decompressedChunk); if (ChunkData.Size >= Globals.MaxBytesPerChunk) { ChunkData = new RawChunk(decompressedChunk.Data); } Header = new CompressedChunkHeader(ChunkData); }
internal CompressedChunk(DecompressedChunk decompressedChunk) { if (decompressedChunk == null) { throw new ArgumentNullException(nameof(decompressedChunk)); } ChunkData = new CompressedChunkData(decompressedChunk); if (ChunkData.Size >= Globals.MaxBytesPerChunk) { ChunkData = new RawChunk(decompressedChunk.Data); } Header = new CompressedChunkHeader(ChunkData); }
internal CompressedChunk(BinaryReader dataReader) { // Contract.Requires<ArgumentNullException>(dataReader != null); // Contract.Ensures(Header != null); // Contract.Ensures(ChunkData != null); Header = new CompressedChunkHeader(dataReader); if (Header.IsCompressed) { ChunkData = new CompressedChunkData(dataReader, Header.CompressedChunkDataSize); } else { ChunkData = new RawChunk(dataReader.ReadBytes(Header.CompressedChunkDataSize)); } }
internal CompressedChunk(BinaryReader dataReader) { if (dataReader == null) { throw new ArgumentNullException(nameof(dataReader)); } Header = new CompressedChunkHeader(dataReader); if (Header.IsCompressed) { ChunkData = new CompressedChunkData(dataReader, Header.CompressedChunkDataSize); } else { ChunkData = new RawChunk(dataReader.ReadBytes(Header.CompressedChunkDataSize)); } }