summaryrefslogtreecommitdiffstats
path: root/dozentenmodulserver/src/main/java/org/openslx
diff options
context:
space:
mode:
Diffstat (limited to 'dozentenmodulserver/src/main/java/org/openslx')
-rw-r--r--dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/fileserv/cow/CowFinalizer.java4
1 files changed, 2 insertions, 2 deletions
diff --git a/dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/fileserv/cow/CowFinalizer.java b/dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/fileserv/cow/CowFinalizer.java
index 9e4a7256..67f38634 100644
--- a/dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/fileserv/cow/CowFinalizer.java
+++ b/dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/fileserv/cow/CowFinalizer.java
@@ -77,7 +77,6 @@ public class CowFinalizer {
}
private void calculateHashes() throws IOException {
- byte[] buffer = new byte[FileChunk.CHUNK_SIZE];
HashChecker hc = IncomingTransferBase.getHashChecker();
if (hc == null) {
LOGGER.info("No hash checker, skipping...");
@@ -96,7 +95,8 @@ public class CowFinalizer {
}
};
for (FileChunk chunk : chunks.getAll()) {
- file.readFully(buffer, 0, chunk.range.getLength());
+ byte[] buffer = new byte[chunk.range.getLength()];
+ file.readFully(buffer);
hc.queue(chunk, buffer, cb, HashChecker.BLOCKING | HashChecker.CALC_CRC32 | HashChecker.CALC_SHA1
| HashChecker.NO_SLOW_WARN);
}