PDFBOX-2530, PDFBOX-2576: avoid throwing RuntimeException; use List instead of ArrayList when possible; make field private that isn't used outside; close OutputStream on checked exception