public PpmdStream(PpmdProperties properties, Stream stream, bool compress) { this.properties = properties; this.stream = stream; this.compress = compress; if (properties.Version == PpmdVersion.I1) { model = new I1.Model(); if (compress) model.EncodeStart(properties); else model.DecodeStart(stream, properties); } if (properties.Version == PpmdVersion.H) { modelH = new H.ModelPPM(); if (compress) throw new NotImplementedException(); else modelH.decodeInit(stream, properties.ModelOrder, properties.AllocatorSize); } if (properties.Version == PpmdVersion.H7z) { modelH = new H.ModelPPM(); if (compress) throw new NotImplementedException(); else modelH.decodeInit(null, properties.ModelOrder, properties.AllocatorSize); decoder = new LZMA.RangeCoder.Decoder(); decoder.Init(stream); } }
public PpmdStream(PpmdProperties properties, Stream stream, bool compress) { this.properties = properties; this.stream = stream; this.compress = compress; if (properties.Version == PpmdVersion.I1) { model = new I1.Model(); if (compress) { model.EncodeStart(properties); } else { model.DecodeStart(stream, properties); } } if (properties.Version == PpmdVersion.H) { modelH = new H.ModelPPM(); if (compress) { throw new NotImplementedException(); } else { modelH.decodeInit(stream, properties.ModelOrder, properties.AllocatorSize); } } if (properties.Version == PpmdVersion.H7z) { modelH = new H.ModelPPM(); if (compress) { throw new NotImplementedException(); } else { modelH.decodeInit(null, properties.ModelOrder, properties.AllocatorSize); } decoder = new LZMA.RangeCoder.Decoder(); decoder.Init(stream); } }