Steamworks.SteamRemoteStorage.FileRead C# (CSharp) Méthode

FileRead() public static méthode

public static FileRead ( string pchFile, byte pvData, int cubDataToRead ) : int
pchFile string
pvData byte
cubDataToRead int
Résultat int
		public static int FileRead(string pchFile, byte[] pvData, int cubDataToRead) {
			InteropHelp.TestIfAvailableClient();
			using (var pchFile2 = new InteropHelp.UTF8StringHandle(pchFile)) {
				return NativeMethods.ISteamRemoteStorage_FileRead(pchFile2, pvData, cubDataToRead);
			}
		}

Usage Example

        public void FileRead()
        {
            FileWrite();

            var data = SteamRemoteStorage.FileRead("testfile");

            Assert.IsNotNull(data);

            for (int i = 0; i < data.Length; i++)
            {
                Assert.AreEqual(data[i], (byte)i);
            }

            Assert.AreEqual(SteamRemoteStorage.FileSize("testfile"), data.Length);
            Assert.AreEqual(SteamRemoteStorage.FileSize("testfile"), 1024 * 1024 * 100);
        }