What is equivalent of fopen_s() in java?

I want to convert this code in java

fopen_s(&stream, "path", "w+");

w+ opens empty file with both reading and writing. If the given file exists, it’s contents are destroyed.

any suggestions?


I am not a Java programmer, but I had a short hunt around the web and it seems Java has a RandomAccessFile and you open it with the mode "rw".

Leave a Reply

Your email address will not be published. Required fields are marked *