public static void writeTYPE(@NotNull StubOutputStream dataStream, @NotNull TypeInfo typeInfo) throws IOException {
    boolean hasTypeAnnotations = typeInfo.myTypeAnnotations != null && !typeInfo.myTypeAnnotations.isEmpty();
    dataStream.writeByte(typeInfo.kind.ordinal() | (hasTypeAnnotations ? HAS_TYPE_ANNOTATIONS : 0));

    if (typeInfo instanceof DerivedTypeInfo) {
      writeTYPE(dataStream, ((DerivedTypeInfo)typeInfo).myChild);
    }
    else if (typeInfo instanceof RefTypeInfo && typeInfo.kind.text == null) {
      if (typeInfo.kind == TypeKind.INNER_SIMPLE) {
        dataStream.writeName(Objects.requireNonNull(((RefTypeInfo)typeInfo).myOuter).myName);
      }
      if (typeInfo.kind == TypeKind.INNER || typeInfo.kind == TypeKind.INNER_GENERIC) {
        writeTYPE(dataStream, Objects.requireNonNull(((RefTypeInfo)typeInfo).myOuter));
      }
      dataStream.writeName(((RefTypeInfo)typeInfo).myName);
      if (typeInfo.kind == TypeKind.INNER_GENERIC || typeInfo.kind == TypeKind.GENERIC) {
        TypeInfo[] components = ((RefTypeInfo)typeInfo).myComponents;
        dataStream.writeByte(components.length);
        for (TypeInfo component : components) {
          writeTYPE(dataStream, component);
        }
      }
    }
    if (hasTypeAnnotations) {
      TypeAnnotationContainer.writeTypeAnnotations(dataStream, typeInfo.myTypeAnnotations);
    }
  }
public static void writeTYPE(@NotNull StubOutputStream dataStream, @NotNull TypeInfo typeInfo)