After a long time debugging and having "out of memory errors" (java heap
space), I was answered why the ByteArrayOutputStream is not closed ? 

 

    public static byte[] InputStreamToArray(InputStream is) throws
IOException {

      byte b[] = new byte[8192];

      ByteArrayOutputStream out = new ByteArrayOutputStream();

      while (true) {

          int read = is.read(b);

          if (read < 1)

            break;

          out.write(b, 0, read);

      }     

      Return out.toByteArray();

    }

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions

Do you like iText?
Buy the iText book: http://www.1t3xt.com/docs/book.php
Or leave a tip: https://tipit.to/itexttipjar

Reply via email to