0
I need to temporarily use one Datainputstream with an inputStream of a socket.
I need to use close-up on Datainputstream? And if I use I’d be closing the socket inputStream too ?
0
I need to temporarily use one Datainputstream with an inputStream of a socket.
I need to use close-up on Datainputstream? And if I use I’d be closing the socket inputStream too ?
2
If you close Datainputstream, it will close the stream you passed in your constructor (in your case, the socket inputStream).
Of the documentation of Datainputstream, in the section methods inherited from the Filterinputstream class has the link to the method close
. Clicking on it the description says that it calls the close
in Inner stream ("This method Simply performs in.close().").
Browser other questions tagged java socket inputstream
You are not signed in. Login or sign up in order to post.
So I should just ignore it , and not close it?
– Rodrigo Santiago
It depends; when you are no longer using Datainputstream, do you still want to use the socket inputStream? If so, then you should not close it.
– carlosfigueira