My task is to open a large file in READ&WRITE mode and i need to search some portion of text in that file by searching starting and end
Claims that the FileChannel.map will load the entire file into memory are faulty, with reference to the MappedByteBuffer that FileChannel.map() returns. It is a 'Direct Byte Buffer', it not exhaust your memory (Direct Byte Buffers use the OS virtual memory subsystem to page data in and out of memory as required, allowing one to address much larger chunks of memory as they were physical RAM.) But then again, a single MBB will only work for files to ~2GB.
Try this:
FileChannel fc = new FileInputStream(fFile).getChannel();
MappedByteBuffer mbb = fc.map(FileChannel.MapMode.READ_ONLY, 0, fc.size());
CharBuffer chrBuff = mbb.asCharBuffer();
It will not load the entire file into memory, and the chrBuff is only a view of the backing MappedByteBuffer, and not a copy.
I'm not sure how to handle the decoding, though.