コード例 #1
0
        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);
        }
コード例 #2
0
        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);
        }
コード例 #3
0
        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));
            }
        }
コード例 #4
0
        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));
            }
        }