Exemplo n.º 1
0
        public IReadOnlyList <StreamedFrame> GenerateFrames(Version version, Platform platform, TransferInstructionFlags flags)
        {
            List <StreamedFrame> frames = new List <StreamedFrame>();

            byte[] memStreamBuffer = new byte[Data.Length * sizeof(uint)];
            Buffer.BlockCopy(Data, 0, memStreamBuffer, 0, memStreamBuffer.Length);
            using (MemoryStream stream = new MemoryStream(memStreamBuffer))
            {
                using (AssetReader reader = new AssetReader(stream, version, platform, flags))
                {
                    while (reader.BaseStream.Position < reader.BaseStream.Length)
                    {
                        StreamedFrame frame = new StreamedFrame();
                        frame.Read(reader);
                        frames.Add(frame);
                    }
                }
            }
            return(frames);
        }
Exemplo n.º 2
0
        public IReadOnlyList <StreamedFrame> GenerateFrames(AssetLayout layout)
        {
            List <StreamedFrame> frames = new List <StreamedFrame>();

            byte[] memStreamBuffer = new byte[Data.Length * sizeof(uint)];
            Buffer.BlockCopy(Data, 0, memStreamBuffer, 0, memStreamBuffer.Length);
            using (MemoryStream stream = new MemoryStream(memStreamBuffer))
            {
                using (AssetReader reader = new AssetReader(stream, EndianType.LittleEndian, layout))
                {
                    while (reader.BaseStream.Position < reader.BaseStream.Length)
                    {
                        StreamedFrame frame = new StreamedFrame();
                        frame.Read(reader);
                        frames.Add(frame);
                    }
                }
            }
            return(frames);
        }