Search code examples
javajasper-reportsinputstream

When does an InputStream object gets closed in JasperReport object?


I am using JRLoader.loadObject(someInputStreamObject) in my project, but I was wondering when does this InputStream object gets closed, is it going to be closed automatically by the object returned by JRLoader.loadObject() ? or do we have to close it?


Solution

  • JasperReports is open source so you can see the source code e.g. on Github for JRLoader.loadObject(InputStream) method. In this case the supplied InputStream object is not being closed by JRLoader so it has to be done manually.