[R2] Added support of reading and writing ints.

Added the support of reading ints from a file and writing them to a
file, also updated the comments so the source is more readable.