From f657a80dc619b35bbe2c30aafbbae86912815073 Mon Sep 17 00:00:00 2001 From: Pierre Maurice Schwang Date: Sun, 13 Feb 2022 13:57:19 +0100 Subject: [PATCH] fix: set size of MappedByteBuffer accordingly (#1608) --- .../core/extent/clipboard/DiskOptimizedClipboard.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/clipboard/DiskOptimizedClipboard.java b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/clipboard/DiskOptimizedClipboard.java index 6b791d4f4..9a9ed58d7 100644 --- a/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/clipboard/DiskOptimizedClipboard.java +++ b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/clipboard/DiskOptimizedClipboard.java @@ -172,7 +172,7 @@ public class DiskOptimizedClipboard extends LinearClipboard implements Closeable if (this.fileChannel == null) { this.fileChannel = braf.getChannel(); 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()); } }