Browse Source

Input stream closing in blender input stream.

git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@7602 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
Kae..pl 14 years ago
parent
commit
068b6a9943

+ 4 - 0
engine/src/blender/com/jme3/scene/plugins/blender/utils/BlenderInputStream.java

@@ -68,6 +68,8 @@ public class BlenderInputStream extends InputStream {
     protected int size;
     /** The current position of the read cursor. */
     protected int position;
+	/** The input stream we read the data from. */
+	protected InputStream		inputStream;
 
     /**
      * Constructor. The input stream is stored and used to read data.
@@ -82,6 +84,7 @@ public class BlenderInputStream extends InputStream {
      */
     public BlenderInputStream(InputStream inputStream, AssetManager assetManager) throws BlenderFileException {
         this.assetManager = assetManager;
+        this.inputStream = inputStream;
         //the size value will canche while reading the file; the available() method cannot be counted on
         try {
             size = inputStream.available();
@@ -376,6 +379,7 @@ public class BlenderInputStream extends InputStream {
 
     @Override
     public void close() throws IOException {
+		inputStream.close();
 //		cachedBuffer = null;
 //		size = position = 0;
     }