我需要以追加模式将数据写入文件(GCS BUCKET FILE),但出现错误
java.lang.UnsupportedOperationException: APPEND
我编写的代码是:
FileSystem fs = FileSystems.getFileSystem(URI.create("gs://test"));
byte[] data = "hello world".getBytes(StandardCharsets.UTF_8);
Path path = fs.getPath("/Testing");
Files.write(path, data,StandardOpenOption.CREATE,StandardOpenOption.APPEND );
这是一个错误还是我遗漏了什么?
最佳答案
关于java - 如何通过java nio writer追加文件?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48498442/