file = new RandomAccessFile("xanadu.txt", "rw");
FileChannel channel = file.getChannel();
ByteBuffer buffer = ByteBuffer.allocate(48);
int byteReads = channel.read(buffer);
SO I am allocating 48 as a capacity in the Buffer. Now consider the txt file I am reading is of about 10MB , so logically it is crossing the buffer allocation size. But when we try to read, we will be able to read all the contents of the file despite the size. SO how this thing is possible.
I am new to this streaming field so may be my question seems to be very basic.