long getEpochDay(int prolepticYear, int monthOfYear, int dayOfMonth) {
checkCalendarInit(); // ensure that the chronology is initialized
checkValidMonth(monthOfYear);
int epochMonth = yearToEpochMonth(prolepticYear) + (monthOfYear - 1);
if (epochMonth < 0 || epochMonth >= hijrahEpochMonthStartDays.length) {
throw new DateTimeException("Invalid Hijrah date, year: " +
prolepticYear + ", month: " + monthOfYear);
}
if (dayOfMonth < 1 || dayOfMonth > getMonthLength(prolepticYear, monthOfYear)) {
throw new DateTimeException("Invalid Hijrah day of month: " + dayOfMonth);
}
return epochMonthToEpochDay(epochMonth) + (dayOfMonth - 1);
}