mirror of
https://github.com/cryptomator/cryptomator.git
synced 2026-07-06 08:06:43 +00:00
- fixed return value of readBlockAligend
- adjusted loglevel of BlockAlignedWritableFile [ci skip]
This commit is contained in:
+9
-5
@@ -69,12 +69,16 @@ class BlockAlignedReadableFile implements ReadableFile {
|
||||
}
|
||||
|
||||
private int readBlockAligned(ByteBuffer target) {
|
||||
int read = -1;
|
||||
while (!eofReached && target.hasRemaining()) {
|
||||
read += ByteBuffers.copy(currentBlockBuffer, target);
|
||||
readCurrentBlockIfNeeded();
|
||||
if (eofReached) {
|
||||
return -1;
|
||||
} else {
|
||||
int read = 0;
|
||||
while (!eofReached && target.hasRemaining()) {
|
||||
read += ByteBuffers.copy(currentBlockBuffer, target);
|
||||
readCurrentBlockIfNeeded();
|
||||
}
|
||||
return read;
|
||||
}
|
||||
return read;
|
||||
}
|
||||
|
||||
private void readCurrentBlockIfNeeded() {
|
||||
|
||||
+1
-1
@@ -54,7 +54,7 @@ class BlockAlignedWritableFile implements WritableFile {
|
||||
|
||||
// visible for testing
|
||||
void switchToBlockAlignedMode() {
|
||||
LOG.debug("switching to blockaligend write...");
|
||||
LOG.trace("switching to blockaligend write...");
|
||||
mode = Mode.BLOCK_ALIGNED;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user