From bd24599b21f9787ac989e65b44dc1ba762162f22 Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Tue, 30 Sep 2014 23:07:50 +0200 Subject: Refine Graph/Font InputStream Capabilities (commit 628509b39ea7c16210315d191860511d6be4aa69) FontFactory Remove: - Font get(final URLConnection conn) - Font get(final InputStream stream) FontFactory Add: - [1] Font get(final InputStream stream, final int streamLen, final boolean closeStream) - Direct usage of font InputStream w/ determined length, may instantiate BufferedInputStream in case given stream doesn't support mark/reset! - [2] Font get(final InputStream stream, final boolean closeStream) - Copy font InputStream w/o determined length, resulting in BufferedInputStream supporting mark/reset! Security Related: - Only perform priviledged code on determine InputStream, _not_ when parsing the font stream itself! - Hence PrivilegedAction only happens in FontFactory's InputStream preparation. Misc: - Use Uri class --- src/jogl/classes/jogamp/graph/font/FontConstructor.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'src/jogl/classes/jogamp/graph/font/FontConstructor.java') diff --git a/src/jogl/classes/jogamp/graph/font/FontConstructor.java b/src/jogl/classes/jogamp/graph/font/FontConstructor.java index 76b5dbb8b..fa176ead9 100644 --- a/src/jogl/classes/jogamp/graph/font/FontConstructor.java +++ b/src/jogl/classes/jogamp/graph/font/FontConstructor.java @@ -30,12 +30,10 @@ package jogamp.graph.font; import java.io.File; import java.io.IOException; import java.io.InputStream; -import java.net.URLConnection; import com.jogamp.graph.font.Font; public interface FontConstructor { - Font create(File file) throws IOException ; - Font create(InputStream stream) throws IOException ; - Font create(URLConnection url) throws IOException ; + Font create(final File file) throws IOException ; + Font create(final InputStream stream, int streamLen) throws IOException ; } -- cgit v1.2.3