fix: set size of MappedByteBuffer accordingly (#1608)

This commit is contained in:
Pierre Maurice Schwang 2022-02-13 13:57:19 +01:00 committed by GitHub
parent de4f73997e
commit f657a80dc6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -172,7 +172,7 @@ public class DiskOptimizedClipboard extends LinearClipboard implements Closeable
if (this.fileChannel == null) { if (this.fileChannel == null) {
this.fileChannel = braf.getChannel(); this.fileChannel = braf.getChannel();
this.fileChannel.lock(); this.fileChannel.lock();
this.byteBuffer = fileChannel.map(FileChannel.MapMode.READ_WRITE, 0, file.length()); this.byteBuffer = fileChannel.map(FileChannel.MapMode.READ_WRITE, 0, braf.length());
} }
} }