Exemplo n.º 1
0
        public PpmdStream(PpmdProperties properties, Stream stream, bool compress)
        {
            _properties = properties;
            _stream     = stream;
            _compress   = compress;

            if (properties.Version == PpmdVersion.I1)
            {
                _model = new Model();
                if (compress)
                {
                    _model.EncodeStart(properties);
                }
                else
                {
                    _model.DecodeStart(stream, properties);
                }
            }
            if (properties.Version == PpmdVersion.H)
            {
                _modelH = new ModelPpm();
                if (compress)
                {
                    throw new NotImplementedException();
                }
                _modelH.DecodeInit(stream, properties.ModelOrder, properties.AllocatorSize);
            }
            if (properties.Version == PpmdVersion.H7Z)
            {
                _modelH = new ModelPpm();
                if (compress)
                {
                    throw new NotImplementedException();
                }
                _modelH.DecodeInit(null, properties.ModelOrder, properties.AllocatorSize);
                _decoder = new Decoder();
                _decoder.Init(stream);
            }
        }