public static void main(String args[]) throws IOException {

        Path path = FileSystems.getDefault().getPath("./src/main/resources", "test.txt");

        Files.write(path,"123\n123\n123".getBytes(), StandardOpenOption.TRUNCATE_EXISTING);

        System.out.println("readAllBytes Read:-");
        System.out.println(new String(Files.readAllBytes(path)));

        System.out.println("newBufferedReader Read:-");
        BufferedReader reader = Files.newBufferedReader(path, Charset.forName("US-ASCII"));
        String line = null;
        while ((line = reader.readLine()) != null) {
            System.out.println(line);
        }

        System.out.println("newByteChannel Read:-");
        // Defaults to READ
        SeekableByteChannel sbc = Files.newByteChannel(path);
        ByteBuffer buf = ByteBuffer.allocate(10);

        // Read the bytes with the proper encoding for this platform.  If
        // you skip this step, you might see something that looks like
        // Chinese characters when you expect Latin-style characters.
        String encoding = System.getProperty("file.encoding");
        int i = 0;
        while ((i = sbc.read(buf)) > 0) {
            //buf.rewind();
            //System.out.print(Charset.forName(encoding).decode(buf));
            buf.flip();
            while(buf.hasRemaining()){
                System.out.print((char) buf.get()); // read 1 byte at a time
            }
            buf.clear();
        }
        sbc.close();

    }