Use alll, what's the problem in that.
An object.close() doesn't give you exception if you have initialized that
object.
But still I think these 3 might be important as it deals with the
inputstream.

fileInput.close()
buf.close()
dataInput.close()

InputStreams must be closed after its contents are obtained by another
object.

Regards,
Shruthi.






On Thu, May 5, 2011 at 3:50 PM, a a <[email protected]> wrote:

> Dear all devs,
>
> try{
>            File newfile = new File(prefix);
>            FileInputStream fileInput = new FileInputStream(newfile);
>            BufferedInputStream buf = new BufferedInputStream(fileInput);
>            final DataInputStream dataInput = new DataInputStream(buf);
> ......
> .....
> } catch(Exception e) {
> ....// I don't know which should i close.
>
> ....// Can anybody tell me which should i close??
> //newfile.close()  ?
> //fileInput.close() ?
> //buf.close() ?
> // dataInput.close() ?
> }
>
> --
> 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

-- 
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