mirror of
https://github.com/Maschell/JNUSLib.git
synced 2024-11-29 11:24:20 +01:00
Add try catch arround the output write in decryptFileStreamHashed to check if the output stream was already closed.
This commit is contained in:
parent
c2579f1cd8
commit
e3dbf81a8e
@ -201,9 +201,8 @@ public class NUSDecryption extends AESDecryption {
|
|||||||
|
|
||||||
byte[] encryptedBlockBuffer = new byte[BLOCKSIZE];
|
byte[] encryptedBlockBuffer = new byte[BLOCKSIZE];
|
||||||
ByteArrayBuffer overflow = new ByteArrayBuffer(BLOCKSIZE);
|
ByteArrayBuffer overflow = new ByteArrayBuffer(BLOCKSIZE);
|
||||||
|
|
||||||
long wrote = 0;
|
long wrote = 0;
|
||||||
int inBlockBuffer;
|
int inBlockBuffer = 0;
|
||||||
do {
|
do {
|
||||||
inBlockBuffer = StreamUtils.getChunkFromStream(inputStream, encryptedBlockBuffer, overflow, BLOCKSIZE);
|
inBlockBuffer = StreamUtils.getChunkFromStream(inputStream, encryptedBlockBuffer, overflow, BLOCKSIZE);
|
||||||
|
|
||||||
@ -222,8 +221,15 @@ public class NUSDecryption extends AESDecryption {
|
|||||||
writeSize = (int) (filesize - wrote);
|
writeSize = (int) (filesize - wrote);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
outputStream.write(output, (int) (0 + soffset), (int) writeSize);
|
outputStream.write(output, (int) (0 + soffset), (int) writeSize);
|
||||||
|
} catch (IOException e) {
|
||||||
|
if (e.getMessage().equals("Pipe closed")) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
e.printStackTrace();
|
||||||
|
throw e;
|
||||||
|
}
|
||||||
wrote += writeSize;
|
wrote += writeSize;
|
||||||
|
|
||||||
block++;
|
block++;
|
||||||
|
Loading…
Reference in New Issue
Block a user