static byte[] ReadAllBytes(string filePath) { #if UNITY_STANDALONE || UNITY_EDITOR || UNITY_IOS return(System.IO.File.ReadAllBytes(filePath)); #elif UNITY_SWITCH nn.fs.FileHandle fileHandle = new nn.fs.FileHandle(); nn.Result result = nn.fs.File.Open(ref fileHandle, filePath, nn.fs.OpenFileMode.Read); result.abortUnlessSuccess(); long fileSize = 0; result = nn.fs.File.GetSize(ref fileSize, fileHandle); result.abortUnlessSuccess(); byte[] data = new byte[fileSize]; result = nn.fs.File.Read(fileHandle, 0, data, fileSize); result.abortUnlessSuccess(); nn.fs.File.Close(fileHandle); return(data); #else return(null); #endif }
public static extern Result Flush(FileHandle handle); // 0x00A159C0-0x00A159E0 public static extern Result SetSize(FileHandle handle, long size); // 0x00A159E0-0x00A15A00
public static extern Result Write(FileHandle handle, long offset, byte[] buffer, long size, WriteOption option); // 0x00A15990-0x00A159C0 public static extern Result Flush(FileHandle handle); // 0x00A159C0-0x00A159E0
public static extern Result Read(ref long outValue, FileHandle handle, long offset, byte[] buffer, long size); // 0x00A15960-0x00A15990 public static extern Result Write(FileHandle handle, long offset, byte[] buffer, long size, WriteOption option); // 0x00A15990-0x00A159C0
public static extern Result Read(ref long outValue, FileHandle handle, long offset, byte[] buffer, long size, ReadOption option); // 0x00A15930-0x00A15960 public static extern Result Read(ref long outValue, FileHandle handle, long offset, byte[] buffer, long size); // 0x00A15960-0x00A15990
public static extern Result Read(FileHandle handle, long offset, byte[] buffer, long size, ReadOption option); // 0x00A158D0-0x00A15900 public static extern Result Read(FileHandle handle, long offset, byte[] buffer, long size); // 0x00A15900-0x00A15930
public static extern nn.Result Open( ref FileHandle outValue, string path, OpenFileMode mode);
public static extern OpenFileMode GetOpenMode(FileHandle handle); // 0x00A15A20-0x00A15A30 public static extern void Close(FileHandle handle); // 0x00A15A30-0x00A15A40
public static extern OpenFileMode GetOpenMode(FileHandle handle);
public static extern nn.Result GetSize(ref long outValue, FileHandle handle);
public static extern nn.Result SetSize(FileHandle handle, long size);
public static extern nn.Result Flush(FileHandle handle);
public static extern nn.Result Write( FileHandle handle, long offset, byte[] buffer, long size, WriteOption option);
public static extern nn.Result Read( ref long outValue, FileHandle handle, long offset, byte[] buffer, long size);
public static extern nn.Result Read( FileHandle handle, long offset, byte[] buffer, long size, ReadOption option);
public static extern Result SetSize(FileHandle handle, long size); // 0x00A159E0-0x00A15A00 public static extern Result GetSize(ref long outValue, FileHandle handle); // 0x00A15A00-0x00A15A20
public static extern Result GetSize(ref long outValue, FileHandle handle); // 0x00A15A00-0x00A15A20 public static extern OpenFileMode GetOpenMode(FileHandle handle); // 0x00A15A20-0x00A15A30
public static extern void Close(FileHandle handle);
public static extern Result Rename(string currentPath, string newPath); // 0x00A15AC0-0x00A15B20 public static extern Result Open(ref FileHandle outValue, string path, OpenFileMode mode); // 0x00A15B20-0x00A15B80
// Methods public static extern Result Read(FileHandle handle, long offset, byte[] buffer, long size, ReadOption option); // 0x00A158D0-0x00A15900