Example #1
0
        /// <summary>
        /// constructor
        /// </summary>
        public PredictionCacheWriter(string dbPath, PredictionCacheHeader header)
        {
            _blockStream = new BlockStream(new Zstandard(), FileUtilities.GetCreateStream(dbPath),
                                           CompressionMode.Compress);

            _writer = new BinaryWriter(_blockStream);
            _header = header;
        }
        /// <summary>
        /// constructor
        /// </summary>
        public PredictionCacheReader(Stream fs)
        {
            _blockStream = new BlockStream(new Zstandard(), fs, CompressionMode.Decompress);
            _reader      = new BinaryReader(_blockStream, Encoding.UTF8, true);

            // read the header
            var headerType = PredictionCacheHeader.GetHeader(0, GenomeAssembly.Unknown, 0);

            FileHeader = (PredictionCacheHeader)_blockStream.ReadHeader(headerType);

            // read the LUT
            _lut = ReadLookupTable(_reader);
        }