Files类中的无缓冲IO支持
import java.io.IOException; import java.io.InputStream; import java.io.OutputStream;/* 来 自 时 代 J a v a*/ import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.Paths; import java.nio.file.StandardOpenOption; public class Main { public static void main(String[] args) throws IOException { try { Path file = Paths.get("/home/docs/users.txt"); Path newFile = Paths.get("/home/docs/newUsers.txt"); try (InputStream in = Files.newInputStream(file); OutputStream out = Files.newOutputStream(newFile, StandardOpenOption.CREATE, StandardOpenOption.APPEND)) { /* from n o w j a v a . c o m*/ int data = in.read();