public void Show(ArchiveListing listing, ArchiveEntry entry)
        {
            _listing = listing;
            _entry = entry;

            if (listing == null || entry == null)
            {
                _textBox.Text = null;
                return;
            }

            FFXIIITextEncoding encoding = InteractionService.TextEncoding.Provide().Encoding;

            ZtrFileEntry[] entries;
            using (Stream data = listing.Accessor.ExtractBinary(entry))
            {
                ZtrFileUnpacker unpacker = new ZtrFileUnpacker(data, encoding);
                entries = unpacker.Unpack();
            }

            if (entries.IsNullOrEmpty())
                return;

            using (MemoryStream ms = new MemoryStream(4096))
            {
                ZtrTextWriter writer = new ZtrTextWriter(ms, StringsZtrFormatter.Instance);
                writer.Write(entry.Name, entries);

                ms.Position = 0;
                using (StreamReader sr = new StreamReader(ms, System.Text.Encoding.UTF8, false))
                    _textBox.Text = sr.ReadToEnd();
            }

            Visibility = Visibility.Visible;
        }
        public void Extract(ArchiveEntry entry, StreamSequence output, Stream input, Byte[] buff)
        {
            int size = (int)entry.UncompressedSize;
            if (size == 0)
                return;

            ZtrFileUnpacker unpacker = new ZtrFileUnpacker(input, InteractionService.TextEncoding.Provide().Encoding);
            ZtrFileEntry[] entries = unpacker.Unpack();

            ZtrTextWriter writer = new ZtrTextWriter(output, StringsZtrFormatter.Instance);
            writer.Write(entry.Name, entries);
        }
        private void Inject(ArchiveListing listing, ArchiveEntry entry, Dictionary<String, String> sourceEntries, Stream output)
        {
            ZtrFileEntry[] targetEntries;
            using (Stream original = listing.Accessor.ExtractBinary(entry))
            {
                ZtrFileUnpacker unpacker = new ZtrFileUnpacker(original, InteractionService.TextEncoding.Provide().Encoding);
                targetEntries = unpacker.Unpack();
            }

            MergeEntries(sourceEntries, targetEntries);

            ZtrFilePacker packer = new ZtrFilePacker(output, InteractionService.TextEncoding.Provide().Encoding);
            packer.Pack(targetEntries);
        }