Ejemplo n.º 1
0
        public Lz4FrameInfo(byte flags)
        {
            int version = flags >> 6;

            if (version != 1)
            {
                throw Lz4Compressor.InvalidData();
            }
            IndependentBlocks  = 0 != (flags & 0x20);
            HasBlockChecksum   = 0 != (flags & 0x10);
            HasContentLength   = 0 != (flags & 8);
            HasContentChecksum = 0 != (flags & 4);
            HasDictionary      = 0 != (flags & 1);
        }
Ejemplo n.º 2
0
        public void SetBlockSize(int code)
        {
            switch ((code >> 4) & 7)
            {
            case 4: BlockSize = 0x10000; break;

            case 5: BlockSize = 0x40000; break;

            case 6: BlockSize = 0x100000; break;

            case 7: BlockSize = 0x400000; break;

            default: throw Lz4Compressor.InvalidData();
            }
        }