throw new IOException("Unsupported version");
}
source.flush();
AttributeFactory factory = AttributeFactory.getInstance();
while (true) {
String name = StreamUtil.readNullTerminatedString(source);
if (name.isEmpty()) {
break;
}
String type = StreamUtil.readNullTerminatedString(source);
int size = source.readInt();
source.flush();
Attribute attribute = factory.create(type, size, source);
if (attribute != null) {
attributes.put(name, attribute);
}