public IoPackedAssemblyFile(bool compressed, string[] packFilepaths, AssetPointer ptr) : base(
         compressed,
         packFilepaths,
         null
         )
 {
     _ptr = ptr;
 }
Exemple #2
0
 public PackedAssemblyFile(bool compression, string[] manifestFilepaths, Assembly assembly, AssetPointer ptr) :
     base(
         compression,
         manifestFilepaths,
         assembly
         )
 {
     _ptr = ptr;
 }
Exemple #3
0
        protected Stream ReadSplittedFile(AssetPointer ptr)
        {
            List<byte> ret = new List<byte>();
            int bytesRead = ptr.Offset;
            int readEndPosition = ptr.Offset + ptr.Length;
            for (int i = 0; i < ManifestFilepaths.Length; i++)
            {
                Stream str = GetResourceStream(i);
                if (i == 0)
                {
                    int readLength = ptr.PackageSize - ptr.Offset;
                    str.Position = ptr.Offset;
                    byte[] rbuf = new byte[ptr.PackageSize - ptr.Offset];
                    str.Read(rbuf, 0, rbuf.Length);
                    ret.AddRange(rbuf);
                    bytesRead += readLength;
                }
                else
                {
                    int readLength = readEndPosition - bytesRead;
                    if (readLength > ptr.PackageSize)
                    {
                        readLength = ptr.PackageSize;
                    }

                    byte[] rbuf = new byte[readLength];
                    str.Read(rbuf, 0, readLength);
                    ret.AddRange(rbuf);
                    bytesRead += readLength;
                }

                str.Close();
            }

            return new MemoryStream(ret.ToArray());
        }