public static void writeChange(DataOutput out, Change change) throws IOException {
    int id = -1;

    Class c = change.getClass();
    if (c.equals(CreateFileChange.class)) id = 1;
    if (c.equals(CreateDirectoryChange.class)) id = 2;
    if (c.equals(ContentChange.class)) id = 3;
    if (c.equals(RenameChange.class)) id = 4;
    if (c.equals(ROStatusChange.class)) id = 5;
    if (c.equals(MoveChange.class)) id = 6;
    if (c.equals(DeleteChange.class)) id = 7;
    if (c.equals(PutLabelChange.class)) id = 8;
    if (c.equals(PutSystemLabelChange.class)) id = 9;

    if (id == -1) throw new IOException("unexpected change type: " + c);

    DataInputOutputUtil.writeINT(out, id);
    change.write(out);
  }
public static void writeChange(DataOutput out, Change change)