From 5c3a81ed64b3fa37dd5010297bc805368ca1fb7c Mon Sep 17 00:00:00 2001 From: Kenneth Russel Date: Mon, 23 May 2005 19:04:47 +0000 Subject: Added constructor taking InputStream git-svn-id: file:///usr/local/projects/SUN/JOGL/git-svn/../svn-server-sync/jogl-demos/trunk@78 3298f667-5e0e-4b4a-8ed4-a3559d26a5f4 --- src/demos/util/ObjReader.java | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'src/demos/util') diff --git a/src/demos/util/ObjReader.java b/src/demos/util/ObjReader.java index 382a658..10882f0 100644 --- a/src/demos/util/ObjReader.java +++ b/src/demos/util/ObjReader.java @@ -68,8 +68,16 @@ public class ObjReader { this(new File(filename)); } + public ObjReader(InputStream in) throws IOException { + this(new InputStreamReader(in)); + } + public ObjReader(File file) throws IOException { - BufferedReader reader = new BufferedReader(new FileReader(file)); + this (new FileReader(file)); + } + + public ObjReader(Reader r) throws IOException { + BufferedReader reader = new BufferedReader(r); String line = null; int lineNo = 0; float[] floatTmp = new float[3]; -- cgit v1.2.3