working read functionality of the file stream