How to get file buffer from file

Can you provide the answer to this question? This is very related to an issue I am currently facing. Thanks in advance for any help!