Input stream closing in blender input stream.
git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@7602 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
This commit is contained in:
parent
f914018dc5
commit
068b6a9943
@ -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;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user