@@ -0,0 +1,1826 @@
+package learntocode.javaapi.io_and_nio.nio;%0D%0A%0D%0Aimport java.io.IOException;%0D%0Aimport java.nio.ByteBuffer;%0D%0Aimport java.nio.channels.SeekableByteChannel;%0D%0Aimport java.nio.file.Files;%0D%0Aimport java.nio.file.Path;%0D%0Aimport java.nio.file.StandardOpenOption;g%0D%0A%0D%0Apublic class ByteChannelAndByteBufferExample %7B%0D%0A%0D%0A    public static void main(String%5B%5D args) throws IOException, InterruptedException %7B%0D%0A        Path path = FilesCreatorNIO.createFiles()%5B0%5D;%0D%0A        String str = %22Hello, world!%22;%0D%0A%0D%0A        /* Create write channel to path */%0D%0A        try (SeekableByteChannel byteChannel = Files.newByteChannel(path, StandardOpenOption.WRITE)) %7B%0D%0A%0D%0A            /* Create buffer and put data from string to this buffer. Rewind buffer, because after putting data buffer's pointer is at the end */%0D%0A            ByteBuffer buffer = ByteBuffer.allocate(str.length());%0D%0A            buffer.put(str.getBytes());%0D%0A            buffer.rewind();%0D%0A%0D%0A            /* Put buffer to channel */%0D%0A            while (buffer.hasRemaining())%0D%0A                byteChannel.write(buffer);%0D%0A%0D%0A            System.out.println(%22'Hello, world!' should now be written to file%22);%0D%0A        %7D%0D%0A%0D%0A        /* Create read channel to path*/%0D%0A        try (SeekableByteChannel byteChannel = Files.newByteChannel(path, StandardOpenOption.READ)) %7B%0D%0A            ByteBuffer buffer = ByteBuffer.allocate(str.length());%0D%0A%0D%0A            /* Read data from channel to buffer */%0D%0A            while (byteChannel.read(buffer) %3E 0) %7B%0D%0A            %7D%0D%0A%0D%0A            /* Rewind buffer, because after reading buffer's pointer is at the end */%0D%0A            buffer.rewind();%0D%0A            System.out.println(%22Output from file is: %22);%0D%0A%0D%0A            /* print out data in buffer */%0D%0A            while (buffer.hasRemaining())%0D%0A                System.out.print((char)buffer.get());%0D%0A        %7D%0D%0A    %7D%0D%0A%7D%0D%0A

Add byte buffer and byte channel example to NIO