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);
}
Exception in thread "main" java.nio.channels.NonWritableChannelException bei sun.nio.ch.FileChannelImpl.map (FileChannelImpl.java:880)JAVA - Nicht beschreibbar Kanal Ausnahme
gibt es die NonwritableChannelException für den obigen Code. Bitte helfen Sie. Vielen Dank.!!
Was ist Ihr DateiModusIn? – developer
Ich erhalte einen Dateimodus als Eingabe, setze aber standardmäßig READ_WRITE – ShreyasMN