Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Regular Contributor
Posts: 75
Registered: ‎07-22-2010
My Device: Not Specified
My Carrier: Trainee

ClassCastException in FileInputStream

Please look at the following code. I am getting ClassCastException in this.



FileInputStream fis =   fis = new FileInputStream(File.FILESYSTEM_PATRIOT,filename);

}catch(Exception t){}



Posts: 40
Registered: ‎10-22-2010
My Device: 9800 Torch
My Carrier: AirTel

Re: ClassCastException in FileInputStream

Hi Dipanwita,


         If you are using 4.1.0.or 4.2.0 then they do not have File.FILESYSTEM.PATRIOT.So it is ClassCastException.


       This is old API, which was intended to use for IDEN devices only. You should use MMAPI (javax.microedition.media.* package) to record and play voice.