Files
类和 Paths
类来获取Linux文件。,,``java,import java.nio.file.Files;,import java.nio.file.Paths;,,public class Main {, public static void main(String[] args) {, try {, byte[] fileBytes = Files.readAllBytes(Paths.get("your_file_path_here"));, System.out.println(new String(fileBytes));, } catch (Exception e) {, e.printStackTrace();, }, },},
``