(Dex.Section in)
| 121 | } |
| 122 | |
| 123 | private void readMap(Dex.Section in) throws IOException { |
| 124 | int mapSize = in.readInt(); |
| 125 | Section previous = null; |
| 126 | for (int i = 0; i < mapSize; i++) { |
| 127 | short type = in.readShort(); |
| 128 | in.readShort(); // unused |
| 129 | Section section = getSection(type); |
| 130 | int size = in.readInt(); |
| 131 | int offset = in.readInt(); |
| 132 | |
| 133 | if ((section.size != 0 && section.size != size) |
| 134 | || (section.off != -1 && section.off != offset)) { |
| 135 | throw new DexException("Unexpected map value for 0x" + Integer.toHexString(type)); |
| 136 | } |
| 137 | |
| 138 | section.size = size; |
| 139 | section.off = offset; |
| 140 | |
| 141 | if (previous != null && previous.off > section.off) { |
| 142 | throw new DexException("Map is unsorted at " + previous + ", " + section); |
| 143 | } |
| 144 | |
| 145 | previous = section; |
| 146 | } |
| 147 | Arrays.sort(sections); |
| 148 | } |
| 149 | |
| 150 | public void computeSizesFromOffsets() { |
| 151 | int end = dataOff + dataSize; |
no test coverage detected