Convert StringIO to a struct.