added filter() method to FilteredIStream and FilteredOStream