On Sep 30, 2013, at 1:01 PM, Samus Arin <[email protected]> wrote:
> When a (java) OutputStreamWriter is instantiated with a (java)
> FileOutputStream
...
> cannot convert from 'Java.IO.FileOutputStream' to 'System.IO.Stream'
>
> Even though I'm using absolute class names, it seems that the compiler is
> still considering "os" a (.net) System.IO.Stream ?
This is (unfortunately) by design. In order to facilitate reuse of existing
.NET code, we made the decision to "hide" many Java types in preference for the
corresponding .NET types. In this case, we hid Java.IO.* types in preference to
System.IO.* types. (In early versions, we didn't even expose many Java.IO.*
types!)
Consequently, there is no OutputStreamWriter(OutputStream) constructor.
This is an unfortunate design choice, and something I'll look into fixing in a
future release (by generating overloads; return types won't change).
In the meantime, if you really want to use Java.IO types, you'll need to use an
intermediate Android.Runtime.OutputStreamInvoker:
var os = new Java.IO.FileOutputStream ("/sdcard/app.log");
var osw = new Java.IO.OutputStreamWriter (new
Android.Runtime.OutputStreamInvoker (os));
- Jon
_______________________________________________
Monodroid mailing list
[email protected]
UNSUBSCRIBE INFORMATION:
http://lists.ximian.com/mailman/listinfo/monodroid