public static void writeEntry(@NotNull DataOutput out, Entry e) throws IOException {
    int id = -1;

    Class c = e.getClass();
    if (c.equals(FileEntry.class)) id = 0;
    if (c.equals(DirectoryEntry.class)) id = 1;

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

    DataInputOutputUtil.writeINT(out, id);
    e.write(out);
  }
public static void writeEntry(@NotNull DataOutput out, Entry e)