}
private DeltaIndex readIndex(ZipInputStream patch) throws IOException {
ZipEntry indexEntry = patch.getNextEntry();
checkArgument(indexEntry.getName().startsWith(".index"), "Unexpected index file name: '{}', must start with '.index'");
LineIterator iter = IOUtils.lineIterator(patch, "UTF-8");
List<? extends IndexEntry> entries = ImmutableList.copyOf(Iterators.transform(iter, new IndexEntryMapper()));
patch.closeEntry();
ImmutableList<IndexEntry.Unchanged> unchanged = ImmutableList.copyOf(Iterables.filter(entries, IndexEntry.Unchanged.class));
ImmutableList<IndexEntry.Created> created = ImmutableList.copyOf(Iterables.filter(entries, IndexEntry.Created.class));
ImmutableList<IndexEntry.Updated> updated = ImmutableList.copyOf(Iterables.filter(entries, IndexEntry.Updated.class));