Author: ssteiner Date: Fri Dec 31 12:34:13 2021 New Revision: 1896579 URL: http://svn.apache.org/viewvc?rev=1896579&view=rev Log: Fix deprecation warnings
Modified: xmlgraphics/fop-pdf-images/trunk/src/java/org/apache/fop/render/pdf/pdfbox/FontContainer.java xmlgraphics/fop-pdf-images/trunk/src/java/org/apache/fop/render/pdf/pdfbox/PDFBoxAdapterUtil.java xmlgraphics/fop-pdf-images/trunk/src/java/org/apache/fop/render/pdf/pdfbox/PDFCloner.java xmlgraphics/fop-pdf-images/trunk/src/java/org/apache/fop/render/pdf/pdfbox/PSPDFGraphics2D.java xmlgraphics/fop-pdf-images/trunk/src/java/org/apache/fop/render/pdf/pdfbox/PreloaderPDF.java Modified: xmlgraphics/fop-pdf-images/trunk/src/java/org/apache/fop/render/pdf/pdfbox/FontContainer.java URL: http://svn.apache.org/viewvc/xmlgraphics/fop-pdf-images/trunk/src/java/org/apache/fop/render/pdf/pdfbox/FontContainer.java?rev=1896579&r1=1896578&r2=1896579&view=diff ============================================================================== --- xmlgraphics/fop-pdf-images/trunk/src/java/org/apache/fop/render/pdf/pdfbox/FontContainer.java (original) +++ xmlgraphics/fop-pdf-images/trunk/src/java/org/apache/fop/render/pdf/pdfbox/FontContainer.java Fri Dec 31 12:34:13 2021 @@ -74,7 +74,7 @@ public class FontContainer { // embedded CMap InputStream input = null; try { - input = ((COSStream)base).getUnfilteredStream(); + input = ((COSStream)base).createInputStream(); CMapParser parser = new CMapParser(); return parser.parse(input); } finally { Modified: xmlgraphics/fop-pdf-images/trunk/src/java/org/apache/fop/render/pdf/pdfbox/PDFBoxAdapterUtil.java URL: http://svn.apache.org/viewvc/xmlgraphics/fop-pdf-images/trunk/src/java/org/apache/fop/render/pdf/pdfbox/PDFBoxAdapterUtil.java?rev=1896579&r1=1896578&r2=1896579&view=diff ============================================================================== --- xmlgraphics/fop-pdf-images/trunk/src/java/org/apache/fop/render/pdf/pdfbox/PDFBoxAdapterUtil.java (original) +++ xmlgraphics/fop-pdf-images/trunk/src/java/org/apache/fop/render/pdf/pdfbox/PDFBoxAdapterUtil.java Fri Dec 31 12:34:13 2021 @@ -71,7 +71,7 @@ public final class PDFBoxAdapterUtil { } sb.append("}"); if (base instanceof COSStream) { - InputStream stream = ((COSStream)base).getFilteredStream(); + InputStream stream = ((COSStream)base).createRawInputStream(); byte[] b = IOUtils.toByteArray(stream); sb.append("COSStream{").append(Arrays.hashCode(b)).append("}"); } Modified: xmlgraphics/fop-pdf-images/trunk/src/java/org/apache/fop/render/pdf/pdfbox/PDFCloner.java URL: http://svn.apache.org/viewvc/xmlgraphics/fop-pdf-images/trunk/src/java/org/apache/fop/render/pdf/pdfbox/PDFCloner.java?rev=1896579&r1=1896578&r2=1896579&view=diff ============================================================================== --- xmlgraphics/fop-pdf-images/trunk/src/java/org/apache/fop/render/pdf/pdfbox/PDFCloner.java (original) +++ xmlgraphics/fop-pdf-images/trunk/src/java/org/apache/fop/render/pdf/pdfbox/PDFCloner.java Fri Dec 31 12:34:13 2021 @@ -178,15 +178,15 @@ public class PDFCloner { PDFStream stream = new PDFStream(); if (adapter.pdfDoc.isEncryptionActive() && originalStream.getItem(COSName.FILTER) == COSName.DCT_DECODE) { stream.getFilterList().addFilter(new DCTFilter()); - in = originalStream.getFilteredStream(); + in = originalStream.createRawInputStream(); filter = Collections.EMPTY_SET; } else if (adapter.pdfDoc.isEncryptionActive() || (originalStream.containsKey(COSName.DECODE_PARMS) && !originalStream.containsKey(COSName.FILTER))) { - in = originalStream.getUnfilteredStream(); + in = originalStream.createInputStream(); filter = adapter.FILTER_FILTER; } else { //transfer encoded data (don't reencode) - in = originalStream.getFilteredStream(); + in = originalStream.createRawInputStream(); filter = Collections.EMPTY_SET; } Modified: xmlgraphics/fop-pdf-images/trunk/src/java/org/apache/fop/render/pdf/pdfbox/PSPDFGraphics2D.java URL: http://svn.apache.org/viewvc/xmlgraphics/fop-pdf-images/trunk/src/java/org/apache/fop/render/pdf/pdfbox/PSPDFGraphics2D.java?rev=1896579&r1=1896578&r2=1896579&view=diff ============================================================================== --- xmlgraphics/fop-pdf-images/trunk/src/java/org/apache/fop/render/pdf/pdfbox/PSPDFGraphics2D.java (original) +++ xmlgraphics/fop-pdf-images/trunk/src/java/org/apache/fop/render/pdf/pdfbox/PSPDFGraphics2D.java Fri Dec 31 12:34:13 2021 @@ -235,7 +235,7 @@ public class PSPDFGraphics2D extends PSG int bits = ((COSInteger)s.getDictionaryObject(COSName.BITS_PER_SAMPLE)).intValue(); COSArray size = (COSArray) s.getDictionaryObject(COSName.SIZE); COSArray encode = getEncode(s); - byte[] x = IOUtils.toByteArray(stream.getUnfilteredStream()); + byte[] x = IOUtils.toByteArray(stream.createInputStream()); for (byte y : x) { if (y != 0) { return new Function(floatArrayToDoubleList(domain.toFloatArray()), Modified: xmlgraphics/fop-pdf-images/trunk/src/java/org/apache/fop/render/pdf/pdfbox/PreloaderPDF.java URL: http://svn.apache.org/viewvc/xmlgraphics/fop-pdf-images/trunk/src/java/org/apache/fop/render/pdf/pdfbox/PreloaderPDF.java?rev=1896579&r1=1896578&r2=1896579&view=diff ============================================================================== --- xmlgraphics/fop-pdf-images/trunk/src/java/org/apache/fop/render/pdf/pdfbox/PreloaderPDF.java (original) +++ xmlgraphics/fop-pdf-images/trunk/src/java/org/apache/fop/render/pdf/pdfbox/PreloaderPDF.java Fri Dec 31 12:34:13 2021 @@ -37,6 +37,7 @@ import org.apache.xmlgraphics.image.load import org.apache.xmlgraphics.image.loader.ImageSize; import org.apache.xmlgraphics.image.loader.impl.AbstractImagePreloader; import org.apache.xmlgraphics.image.loader.util.ImageUtil; +import org.apache.xmlgraphics.io.XmlSourceUtil; import org.apache.xmlgraphics.util.io.SubInputStream; import org.apache.fop.datatypes.URISpecification; @@ -172,12 +173,12 @@ public class PreloaderPDF extends Abstra } public PDDocument make() throws Exception { - final InputStream in = ImageUtil.needInputStream(src); + final InputStream in = XmlSourceUtil.needInputStream(src); try { PDDocument pddoc = PDDocument.load(new SubInputStream(in, Integer.MAX_VALUE)); return Interceptors.getInstance().interceptOnLoad(pddoc, docURI); } finally { - ImageUtil.closeQuietly(src); + XmlSourceUtil.closeQuietly(src); } } }; --------------------------------------------------------------------- To unsubscribe, e-mail: fop-commits-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-commits-h...@xmlgraphics.apache.org