Added closefile method (that closes the file). Removed unused rbuf member variable. Made some functions virtual.