}
} else {
List<String> types = new ArrayList<>(size);
List<String> ids = new ArrayList<>(size);
List<String[]> fields = new ArrayList<>(size);
LongArrayList versions = new LongArrayList(size);
List<VersionType> versionTypes = new ArrayList<>(size);
List<FetchSourceContext> fetchSourceContexts = new ArrayList<>(size);
for (int i = 0; i < size; i++) {
locations.add(in.readVInt());
if (in.readBoolean()) {
types.add(in.readSharedString());
} else {
types.add(null);
}
ids.add(in.readString());
int size1 = in.readVInt();
if (size1 > 0) {
String[] fieldsArray = new String[size1];
for (int j = 0; j < size1; j++) {
fieldsArray[j] = in.readString();
}
fields.add(fieldsArray);
} else {
fields.add(null);
}
versions.add(Versions.readVersionWithVLongForBW(in));
versionTypes.add(VersionType.fromValue(in.readByte()));
fetchSourceContexts.add(FetchSourceContext.optionalReadFromStream(in));
}
for (int i = 0; i < size; i++) {
//before 1.4 we have only one index, the concrete one
MultiGetRequest.Item item = new MultiGetRequest.Item(index, types.get(i), ids.get(i))
.fields(fields.get(i)).version(versions.get(i)).versionType(versionTypes.get(i))
.fetchSourceContext(fetchSourceContexts.get(i));
items.add(item);
}
}