Exemplo n.º 1
0
        private void PackBigEndianCompressedDictionary(ZtrFileEntry[] entries)
        {
            _bw.Write((int)ZtrFileType.BigEndianCompressedDictionary);

            ZtrFileHeader header = new ZtrFileHeader
            {
                Version = 1,
                Count   = entries.Length
            };

            using (MemoryStream ms = new MemoryStream(32 * 1024))
            {
                ZtrFileKeysPacker keyPacker = new ZtrFileKeysPacker(ms, entries);
                keyPacker.Pack(header);

                ZtrFileTextPacker textPacker = new ZtrFileTextPacker(ms, entries, _encoding);
                textPacker.Pack(header);

                header.WriteToStream(_output);
                ms.Position = 0;
                ms.CopyTo(_output);
            }
        }
Exemplo n.º 2
0
        private void PackBigEndianCompressedDictionary(ZtrFileEntry[] entries)
        {
            if (entries.Length > 0)
                throw new NotImplementedException();

            _bw.Write((int)ZtrFileType.BigEndianCompressedDictionary);

            ZtrFileHeader header = new ZtrFileHeader();
            header.Version = 1;
            header.Count = entries.Length;

            using (MemoryStream ms = new MemoryStream(32 * 1024))
            {
                ZtrFileKeysPacker keyPacker = new ZtrFileKeysPacker(ms, entries);
                keyPacker.Pack(header);

                ZtrFileTextPacker textPacker = new ZtrFileTextPacker(ms, entries, header, _encoding);
                textPacker.Pack();
            }

            long headerPosition = _output.Position;

            //_output.Seek(entries.Length * 8)
        }