mirror of
https://github.com/cryptomator/cryptomator.git
synced 2026-05-17 18:21:26 +00:00
- fixed return value of readBlockAligend
- adjusted loglevel of BlockAlignedWritableFile [ci skip]
This commit is contained in:
@@ -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() {
|
||||
|
||||
@@ -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