Java tutorial
import java.nio.file.StandardOpenOption; import java.nio.channels.SeekableByteChannel; import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.Paths; public class Main { public static void main(String[] args) throws Exception { Path src = Paths.get("test2.txt"); SeekableByteChannel sbc = Files.newByteChannel(src, StandardOpenOption.READ, StandardOpenOption.WRITE, StandardOpenOption.CREATE); } }