(String label, int index)
| 407 | } |
| 408 | |
| 409 | private DBElement decodeStruct(String label, int index) |
| 410 | throws DBException |
| 411 | { |
| 412 | if (index >= this.structArrayCount) { |
| 413 | throw new DBException(this.name + ": Structure index " + index + " exceeds array size"); |
| 414 | } |
| 415 | |
| 416 | int offset = 12 * index; |
| 417 | int id = getInteger(this.structBuffer, offset); |
| 418 | int fieldIndex = getInteger(this.structBuffer, offset + 4); |
| 419 | int fieldCount = getInteger(this.structBuffer, offset + 8); |
| 420 | DBList list = new DBList(fieldCount); |
| 421 | if (fieldCount == 1) { |
| 422 | DBElement field = decodeField(fieldIndex); |
| 423 | list.addElement(field); |
| 424 | } else if (fieldCount > 1) { |
| 425 | offset = fieldIndex; |
| 426 | for (int i = 0; i < fieldCount; i++) { |
| 427 | if (offset + 4 > this.fieldIndicesLength) { |
| 428 | throw new DBException("Field indices offset " + offset + " exceeds indices size"); |
| 429 | } |
| 430 | fieldIndex = getInteger(this.fieldIndicesBuffer, offset); |
| 431 | offset += 4; |
| 432 | DBElement field = decodeField(fieldIndex); |
| 433 | list.addElement(field); |
| 434 | } |
| 435 | } |
| 436 | |
| 437 | return new DBElement(14, id, label, list); |
| 438 | } |
| 439 | |
| 440 | private DBElement decodeList(String label, int offset) |
| 441 | throws DBException |
no test coverage detected