Mono for Android将一些Java构造转换为“等效”.NET构造,以简化类.NET平台之间的代码共享.作为其中的一部分,java.io.InputStream和java.io.OutputStream被映射到System.IO.Stream,因此编译器错误.
您在System.IO.Stream上不存在的InputStream上是否存在任何需要的内容?
There is a direct function to copy a file from assets to device memory but that requires source and destination path.
我不知道你在这里指的是什么InputStream方法.您可以使用Stream.CopyTo(Stream)来执行此操作:
Stream asset = context.Assets.Open(DATABASE_NAME + ".db");
string dbPath = System.IO.Path.Combine(
System.Environment.GetFolderPath(System.Environment.SpecialFolder.Personal),
"YourFile.xml");
using (var dest = System.IO.File.OpenWrite(destPath))
asset.CopyTo(dest);