コード例 #1
0
        public BrutePackBlock?CompressBlock(byte[] data, int length)
        {
            var memStream = new MemoryStream();

            ArithmeticCoder.EncodeBlockStream(data, memStream, length, InnerChunkSize);
            if (memStream.Position >= 1024 * 1024 * 2)
            {
                return(null);
            }
            return(new BrutePackBlock(BlockType.Arithmetic, memStream.ToArray()));
        }
コード例 #2
0
 public byte[] Decompress(BrutePackBlock block)
 {
     return(ArithmeticCoder.DecodeBlockStream(new MemoryStream(block.BlockData)));
 }