Added capability to work with streams and files.