public static final Type unserializeType(Unserializer unserializer) throws UnserializationException
{
int size = (int)unserializer.getLong();
if (size < 1) {
throw new UnserializationException();
}
unserializer.consume('s');
String source = unserializer.getUTF16String();
Type type = unserializer.getContext().import_(source);
for(int i=1; i<size; i++) {
unserializer.consume('s');
String name = unserializer.getUTF16String();
if (type instanceof Scope) {
type = ((Scope)type).lookupDeclaration(name);
} else {
type = null;
break;
}
}
if (type == null) {
throw new UnserializationException();
}
return type;
}