(long eocdOffset)
| 170 | } |
| 171 | |
| 172 | private long parseZip64EocdRecordLocator(long eocdOffset) |
| 173 | throws IOException { |
| 174 | // The spec stays curiously silent about whether a zip file with an EOCD record, |
| 175 | // a zip64 locator and a zip64 eocd record is considered "empty". In our implementation, |
| 176 | // we parse all records and read the counts from them instead of drawing any size or |
| 177 | // layout based information. |
| 178 | if (eocdOffset > ZIP64_LOCATOR_SIZE) { |
| 179 | _seek(eocdOffset - ZIP64_LOCATOR_SIZE); |
| 180 | if (_readInt() == ZIP64_LOCATOR_SIGNATURE) { |
| 181 | final int diskWithCentralDir = _readInt(); |
| 182 | final long zip64EocdRecordOffset = _readLong(); |
| 183 | final int numDisks = _readInt(); |
| 184 | if (numDisks != 1 || diskWithCentralDir != 0) { |
| 185 | throw new IOException("Spanned archives not supported"); |
| 186 | } |
| 187 | return zip64EocdRecordOffset; |
| 188 | } |
| 189 | } |
| 190 | return -1; |
| 191 | } |
| 192 | |
| 193 | private EocdRecord parseEocdRecord(long offset, boolean isZip64) throws IOException { |
| 194 | _seek(offset); |
no test coverage detected