X-Git-Url: http://git.megacz.com/?p=anneal.git;a=blobdiff_plain;f=src%2Fedu%2Fberkeley%2Fqfat%2FStlFile.java;h=5a283c91d0f5b74e2f59538694ae46ea17984c19;hp=b1eaca6af3366df6c864fe90fb5dab47afe9fd6a;hb=1cfea6e5d6ca9e75578e97d1fdccf2b306af56c4;hpb=e3aa83b5505dcfbc200e29e5b1701664bb218709 diff --git a/src/edu/berkeley/qfat/StlFile.java b/src/edu/berkeley/qfat/StlFile.java index b1eaca6..5a283c9 100644 --- a/src/edu/berkeley/qfat/StlFile.java +++ b/src/edu/berkeley/qfat/StlFile.java @@ -14,6 +14,7 @@ import java.io.BufferedReader; import java.io.FileReader; import java.io.InputStreamReader; import java.io.FileInputStream; +import java.io.InputStream; import java.io.FileNotFoundException; import java.io.IOException; @@ -426,9 +427,8 @@ public class StlFile implements Loader * * @throws IOException */ - private void readBinaryFile(String file) throws IOException + public void readBinaryFile(String file, InputStream data) throws IOException { - FileInputStream data; // For reading the file ByteBuffer dataBuffer; // For reading in the correct endian byte[] Info=new byte[80]; // Header data byte[] Array_number= new byte[4]; // Holds the number of faces @@ -447,7 +447,6 @@ public class StlFile implements Loader } else { // It's a local file - data = new FileInputStream(file); // First 80 bytes aren't important if(80 != data.read(Info)) @@ -571,7 +570,7 @@ public class StlFile implements Loader else { // Binary file try{ - readBinaryFile(getFileName()); + readBinaryFile(getFileName(), new FileInputStream(getFileName())); } catch(IOException e) {