Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,10 @@ public void execute(CommandLine commandLine, Options options, RPCHook rpcHook)
throw new SubCommandException("file " + fileName + " is a directory.");
}

try {
try (RandomAccessFile raf = new RandomAccessFile(fileName, "r");
FileChannel fileChannel = raf.getChannel()) {
long fileSize = Files.size(filePath);
FileChannel fileChannel = new RandomAccessFile(fileName, "rw").getChannel();
ByteBuffer buf = fileChannel.map(MapMode.READ_WRITE, 0, fileSize);
ByteBuffer buf = fileChannel.map(MapMode.READ_ONLY, 0, fileSize);

int current = 0;
while (current < fileSize) {
Expand Down
Loading