I have this simple code that reads raw resource. For some reason the
inputStream.read call seems to throw an exception but it is not
handled by the catch it goes to the finally. Of caurse the return
inputBuffer is not executed but the  return new byte[0]; is.




try
                {
                        inputStream = 
_Context.getResources().openRawResource(resourceId);
                        int count = inputStream.available();
                        byte[]  inputBuffer = new byte [count ];
                        inputStream.read(inputBuffer);
                        return inputBuffer;
                }
                catch (IOException e)
                {
                        Log.e(this.getClass().toString(), e.toString());
                }
                finally
                {
                        try
                        {
                                inputStream.close();
                        }
                        catch (IOException e)
                        {
                                Log.e(this.getClass().toString(), e.toString());
                        }
                }


                return new byte[0];

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to