MCPcopy Create free account
hub / github.com/boazy/TWEditorEnhanced / decodeList

Method decodeList

src/main/java/Database.java:440–460  ·  view source on GitHub ↗
(String label, int offset)

Source from the content-addressed store, hash-verified

438 }
439
440 private DBElement decodeList(String label, int offset)
441 throws DBException
442 {
443 if (offset + 4 > this.listIndicesLength) {
444 throw new DBException(this.name + ": List indices offset " + offset + " exceeds indices size");
445 }
446
447 int structCount = getInteger(this.listIndicesBuffer, offset);
448 DBList list = new DBList(structCount);
449 int listOffset = offset + 4;
450 for (int i = 0; i < structCount; i++) {
451 if (listOffset + 4 > this.listIndicesLength) {
452 throw new DBException(this.name + ": List indices offset " + listOffset + " exceeds indices size");
453 }
454 int structIndex = getInteger(this.listIndicesBuffer, listOffset);
455 listOffset += 4;
456 list.addElement(decodeStruct(new String(), structIndex));
457 }
458
459 return new DBElement(15, 0, label, list);
460 }
461
462 public void save()
463 throws DBException, IOException

Callers 1

decodeFieldMethod · 0.95

Calls 3

getIntegerMethod · 0.95
addElementMethod · 0.95
decodeStructMethod · 0.95

Tested by

no test coverage detected