If you don't want external files then have search for the

ReadFile APIs and WriteFile APIs..

If i have time, ill post an example later...