Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
*/
package org.apache.fontbox.ttf;

import java.io.BufferedInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
Expand Down Expand Up @@ -209,8 +208,7 @@ public final class OpenTypeScript
static
{
String path = "/org/apache/fontbox/unicode/Scripts.txt";
try (InputStream resourceAsStream = OpenTypeScript.class.getResourceAsStream(path);
InputStream input = new BufferedInputStream(resourceAsStream))
try (InputStream input = OpenTypeScript.class.getResourceAsStream(path))
{
parseScriptsFile(input);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,9 +134,9 @@ private static void loadMetrics(FontName fontName) throws IOException
{
throw new IOException("resource '" + resourceName + "' not found");
}
try (InputStream afmStream = new BufferedInputStream(resourceAsStream))
try (resourceAsStream)
{
AFMParser parser = new AFMParser(afmStream);
AFMParser parser = new AFMParser(resourceAsStream);
FontMetrics metric = parser.parse(true);
FONTS.put(fontName, metric);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,9 +107,9 @@ protected ICC_Profile getICCProfile() throws IOException
{
throw new IOException("resource '" + resourceName + "' not found");
}
try (InputStream is = new BufferedInputStream(resourceAsStream))
try (resourceAsStream)
{
return ICC_Profile.getInstance(is);
return ICC_Profile.getInstance(resourceAsStream);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1974,8 +1974,7 @@ private String handleDirection(String word)
static
{
String path = "/org/apache/pdfbox/resources/text/BidiMirroring.txt";
try (InputStream resourceAsStream = PDFTextStripper.class.getResourceAsStream(path);
InputStream input = new BufferedInputStream(resourceAsStream))
try (InputStream input = PDFTextStripper.class.getResourceAsStream(path))
{
parseBidiFile(input);
}
Expand Down
3 changes: 1 addition & 2 deletions pdfbox/src/main/java/org/apache/pdfbox/util/Version.java
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,7 @@ private Version()
*/
public static String getVersion()
{
try (InputStream resourceAsStream = Version.class.getResourceAsStream(PDFBOX_VERSION_PROPERTIES);
InputStream is = new BufferedInputStream(resourceAsStream))
try (InputStream is = Version.class.getResourceAsStream(PDFBOX_VERSION_PROPERTIES))
{
Properties properties = new Properties();
properties.load(is);
Expand Down