Changed check from hard 'StringIO' to more flexible and useable attribute-check on 'read', for file-objects.