works with remote file streams