erdemolkun / plist

Automatically exported from code.google.com/p/plist
0 stars 0 forks source link

java.lang.ClassCastException: android.content.res.AssetManager$AssetInputStream cannot be cast to com.dd.plist.Base64$InputStream #47

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?

try {
   InputStream is = (InputStream)      this.getResources().openRawResource(R.raw.page001);
  NSDictionary rootDict = (NSDictionary)PropertyListParser.parse(is);
 TV.setText(rootDict.count());
 Log.e("tttttt",""+rootDict.count());  
} catch(Exception ex) {
TV.setText(ex.toString());
Log.e("tttttt", ex.toString());
}

What is the expected output? What do you see instead?
Exception 
java.lang.ClassCastException: android.content.res.AssetManager$AssetInputStream 
cannot be cast to com.dd.plist.Base64$InputStream

What version of the product are you using? On what operating system?

Please provide any additional information below.

Original issue reported on code.google.com by maatkiib...@gmail.com on 17 Aug 2014 at 6:15

Attachments:

GoogleCodeExporter commented 9 years ago
You have imported the wrong InputStream (com.dd.plist.Base64.InputStream) in 
your Java class. That is a custom class to which the input stream returned by 
openRawResource cannot be cast. Please use java.io.InputStream instead.

Original comment by daniel.dreibrodt on 17 Aug 2014 at 7:03