Allows string to be used as stream resource.