public FileProcessor(String filenameIn, String fileModeIn){
try {
randomaccessfile = new RandomAccessFile(filenameIn, fileModeIn);
fileChannel = randomaccessfile.getChannel();
buffer = fileChannel.map(FileChannel.MapMode.READ_WRITE, 0, fileChannel.size());
} catch (FileNotFoundException e) {
System.err.println("Error while creating a File");
e.printStackTrace();
System.exit(1);
} catch (IOException e) {
System.err.println("Error while creating MappedByteBuffer");
e.printStackTrace();
System.exit(1);
}
sun.nio.ch.FileChannelImpl.map에서 스레드에서 예외 "주"java.nio.channels.NonWritableChannelException (FileChannelImpl.java:880)자바 - 비 쓰기 가능한 채널 예외
NonwritableChannelException 얻기 위의 코드는 도와주세요. 감사.!!
ur fileModeIn은 무엇입니까? – developer
입력으로 filemode가 표시되지만 기본적으로 READ_WRITE로 설정됩니다. – ShreyasMN