rt = new primitiveTypeCode(kind);
rt = new PrimitiveTypeCode(kind);
  public static TypeCode read(org.omg.CORBA.portable.InputStream in)                       throws BadKind, Bounds  {    TCKind kind = TCKind.from_int(in.read_long());    TypeCode rt;    generalTypeCode g;    recordTypeCode r;    recordTypeCode.Field f;    stringTypeCode s;    int n;    switch (kind.value())      {        case TCKind._tk_sequence :        case TCKind._tk_array :          primitiveArrayTypeCode p = new primitiveArrayTypeCode(kind);          p.setLength(in.read_long());          rt = p;          break;                  case TCKind._tk_string :        case TCKind._tk_wstring :          s = new stringTypeCode(kind);          s.setLength(in.read_long());          rt = s;          break;        case TCKind._tk_fixed :          fixedTypeCode fx = new fixedTypeCode();          fx.setDigits(in.read_short());          fx.setScale(in.read_short());          rt = fx;          break;        case TCKind._tk_objref :        case TCKind._tk_native :        case TCKind._tk_abstract_interface :          g = new generalTypeCode(kind);          g.setId(in.read_string());          g.setName(in.read_string());          rt = g;          break;        case TCKind._tk_alias :        case TCKind._tk_value_box :          g = new generalTypeCode(kind);          g.setId(in.read_string());          g.setName(in.read_string());          g.setContentType(in.read_TypeCode());          rt = g;          break;        case TCKind._tk_struct :        case TCKind._tk_except :          r = new recordTypeCode(kind);          r.setId(in.read_string());          r.setName(in.read_string());          n = in.read_long();          for (int i = 0; i < n; i++)            {              f = r.field();              f.name = in.read_string();              f.type = in.read_TypeCode();            }          rt = r;          break;        case TCKind._tk_enum :          r = new recordTypeCode(kind);          r.setId(in.read_string());          r.setName(in.read_string());          n = in.read_long();          for (int i = 0; i < n; i++)            {              f = r.field();              f.name = in.read_string();            }          rt = r;          break;        case TCKind._tk_union :          r = new recordTypeCode(kind);          r.setId(in.read_string());          r.setName(in.read_string());          r.setDiscriminator_type(in.read_TypeCode());          r.setDefaultIndex(in.read_long());          n = in.read_long();          for (int i = 0; i < n; i++)            {              f = r.field();              f.label = in.read_any();              f.name = in.read_string();              f.type = in.read_TypeCode();            }          rt = r;          break;        case TCKind._tk_value :          r = new recordTypeCode(kind);          r.setId(in.read_string());          r.setName(in.read_string());          r.setTypeModifier(in.read_short());          r.setConcreteBase_type(in.read_TypeCode());          n = in.read_long();          for (int i = 0; i < n; i++)            {              f = r.field();              f.name = in.read_string();              f.type = in.read_TypeCode();              f.visibility = in.read_short();            }          rt = r;          break;        default :          rt = new primitiveTypeCode(kind);      }    return rt;  }