i have
public void write(File file, String string) {
Path path = file.toPath();
ByteBuffer buffer = ByteBuffer.allocate(1024);
buffer.put(string.getBytes());
buffer.flip();
try(AsynchronousFileChannel asyncChannel = AsynchronousFileChannel.open(path, StandardOpenOption.WRITE)){
Future<Integer> future = asyncChannel.write(buffer, 0);
while(!future.isDone()) {
}
buffer.clear();
} catch (IOException e) {
e.printStackTrace();
}
}```
which writes to a file fine but it only writes to the 1st line and will override what is already there, i just want it to write the text to the line bellow