|
@@ -68,6 +68,8 @@ public class BlenderInputStream extends InputStream {
|
|
protected int size;
|
|
protected int size;
|
|
/** The current position of the read cursor. */
|
|
/** The current position of the read cursor. */
|
|
protected int position;
|
|
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.
|
|
* 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 {
|
|
public BlenderInputStream(InputStream inputStream, AssetManager assetManager) throws BlenderFileException {
|
|
this.assetManager = assetManager;
|
|
this.assetManager = assetManager;
|
|
|
|
+ this.inputStream = inputStream;
|
|
//the size value will canche while reading the file; the available() method cannot be counted on
|
|
//the size value will canche while reading the file; the available() method cannot be counted on
|
|
try {
|
|
try {
|
|
size = inputStream.available();
|
|
size = inputStream.available();
|
|
@@ -376,6 +379,7 @@ public class BlenderInputStream extends InputStream {
|
|
|
|
|
|
@Override
|
|
@Override
|
|
public void close() throws IOException {
|
|
public void close() throws IOException {
|
|
|
|
+ inputStream.close();
|
|
// cachedBuffer = null;
|
|
// cachedBuffer = null;
|
|
// size = position = 0;
|
|
// size = position = 0;
|
|
}
|
|
}
|