コード例 #1
0
        public void Extract(ArchiveEntry entry, StreamSequence output, Stream input, Byte[] buff)
        {
            int size = (int)entry.UncompressedSize;
            if (size == 0)
                return;

            input.CopyToStream(output, size, buff);
        }
コード例 #2
0
        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);
        }
コード例 #3
0
        public void Extract(ArchiveEntry entry, StreamSequence output, Stream input, Byte[] buff)
        {
            int size = (int)entry.UncompressedSize;
            if (size == 0)
                return;

            ScdFileReader reader = new ScdFileReader(input);
            WaveStream[] waveStreams = reader.Read();
            if (waveStreams.Length == 0)
                return;

            Extract(output, waveStreams[0], buff);

            for (int i = 1; i < waveStreams.Length; i++)
            {
                if (!output.TryCreateNextStream(i.ToString("D3")))
                    throw new InvalidDataException();

                Extract(output, waveStreams[i], buff);
            }
        }