how do we check if the buffer contains data, so that we could read from it
What type of application are you trying to capture/steal data from?
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.