I\'ve got some production code that does something like:
HttpServletRequest httpServletRequest
...
DataInputStream dis = new DataInputStream(httpServletReque
The thumb rule in I/O is, if you did not open/create the inputstream source yourself, then you do not necessarily need to close it as well. Here you are just wrapping the request's inputstream, so you don't necessarily need to close it.
If you did open the input yourself by e.g. new FileInputStream("c:/file.ext") then you obviously need to close it yourself in the finally block. The container ought to do so under the hood.