Abstracting file streams