|
@@ -1,22 +1,22 @@
|
|
|
/*
|
|
|
* Copyright (c) 2009-2010 jMonkeyEngine
|
|
|
* All rights reserved.
|
|
|
- *
|
|
|
+ *
|
|
|
* Redistribution and use in source and binary forms, with or without
|
|
|
* modification, are permitted provided that the following conditions are
|
|
|
* met:
|
|
|
- *
|
|
|
+ *
|
|
|
* * Redistributions of source code must retain the above copyright
|
|
|
* notice, this list of conditions and the following disclaimer.
|
|
|
- *
|
|
|
+ *
|
|
|
* * Redistributions in binary form must reproduce the above copyright
|
|
|
* notice, this list of conditions and the following disclaimer in the
|
|
|
* documentation and/or other materials provided with the distribution.
|
|
|
- *
|
|
|
+ *
|
|
|
* * Neither the name of 'jMonkeyEngine' nor the names of its contributors
|
|
|
* may be used to endorse or promote products derived from this software
|
|
|
* without specific prior written permission.
|
|
|
- *
|
|
|
+ *
|
|
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
|
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
|
|
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
|
@@ -36,6 +36,7 @@ import com.jme3.asset.AssetKey;
|
|
|
import com.jme3.export.Savable;
|
|
|
import com.jme3.export.binary.BinaryExporter;
|
|
|
import com.jme3.gde.core.scene.SceneApplication;
|
|
|
+import java.io.BufferedOutputStream;
|
|
|
import java.io.IOException;
|
|
|
import java.io.OutputStream;
|
|
|
import java.lang.reflect.InvocationTargetException;
|
|
@@ -231,7 +232,9 @@ public class AssetDataObject extends MultiDataObject {
|
|
|
out = outFileObject.getOutputStream();
|
|
|
outFileObject.getParent().refresh();
|
|
|
}
|
|
|
- exp.save(savable, out);
|
|
|
+ try (BufferedOutputStream bout = new BufferedOutputStream(out)) {
|
|
|
+ exp.save(savable, bout);
|
|
|
+ }
|
|
|
} finally {
|
|
|
// if (lock != null) {
|
|
|
// lock.releaseLock();
|
|
@@ -239,7 +242,7 @@ public class AssetDataObject extends MultiDataObject {
|
|
|
if (out != null) {
|
|
|
out.close();
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
progressHandle.finish();
|
|
|
setModified(false);
|
|
|
}
|