use of com.google.gerrit.reviewdb.client.Patch.ChangeType in project gerrit by GerritCodeReview.
the class PatchListEntry method readFrom.
static PatchListEntry readFrom(InputStream in) throws IOException {
ChangeType changeType = readEnum(in, ChangeType.values());
PatchType patchType = readEnum(in, PatchType.values());
String oldName = readString(in);
String newName = readString(in);
byte[] hdr = readBytes(in);
int ins = readVarInt32(in);
int del = readVarInt32(in);
long size = readFixInt64(in);
long sizeDelta = readFixInt64(in);
int editCount = readVarInt32(in);
Edit[] editArray = new Edit[editCount];
for (int i = 0; i < editCount; i++) {
int beginA = readVarInt32(in);
int endA = readVarInt32(in);
int beginB = readVarInt32(in);
int endB = readVarInt32(in);
editArray[i] = new Edit(beginA, endA, beginB, endB);
}
return new PatchListEntry(changeType, patchType, oldName, newName, hdr, toList(editArray), ins, del, size, sizeDelta);
}
Aggregations