Esempio n. 1
0
            public static float Size(string fileName, int hMPQ)
            {
                uint fileSize = 0;
                int  hFile    = -1;

                if (ShadowFlare.OpenFile(fileName, ref hFile))
                {
                    uint fileSizeHigh = 0;
                    fileSize = ShadowFlare.FileSize(hFile, ref fileSizeHigh);
                }
                return(Convert.ToSingle(fileSize) / 1000f);
            }
Esempio n. 2
0
            public static byte[] Read(string fileName, int hMPQ)
            {
                int hFile = -1;

                if (ShadowFlare.OpenFile(fileName, ref hFile))
                {
                    uint fileSizeHigh = 0;
                    uint fileSize     = ShadowFlare.FileSize(hFile, ref fileSizeHigh);
                    if ((fileSizeHigh == 0) && (fileSize > 0))
                    {
                        byte[] result    = new byte[fileSize];
                        uint   countRead = 0;
                        ShadowFlare.ReadFile(hFile, result, fileSize, ref countRead, 0);
                        ShadowFlare.CloseFile(hFile);
                        return(result);
                    }
                }
                return(null);
            }