Skip to content
Open
Changes from 1 commit
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,9 +69,9 @@ public void execute(CommandLine commandLine, Options options, RPCHook rpcHook)
throw new SubCommandException("file " + fileName + " is a directory.");
}

try {
try (RandomAccessFile raf = new RandomAccessFile(fileName, "rw");
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use read only mode

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);

int current = 0;
Expand Down