Monali Sonawane,
Sounds like you have a good idea already, are the bytes you get the correct bytes? In other words, the bytes you recieve, are they correct, in the correct order? You could try changing the logic slightly and only use the second RAM. That way you will see if it is the RAM or the Buffering as you suspect. Is there somekind of "flush" command you can use on your communications port interface? I know I have had problems like that in the past where part of my file is stuck in a buffer and you have to flush or exit the application to get it to finish writing to a file, for instance.
Hope that helps some
Sckoarn