DateFormat (CF cf, Pointer localeRef, long dateStyle, long timeStyle, Locale locale) { Pointer formatter = cf.CFDateFormatterCreate(null, localeRef, dateStyle, timeStyle); if (formatter == null) throw new IllegalStateException("CFDateFormatterCreate: null"); try { Pointer format = cf.CFDateFormatterGetFormat(formatter); return formatFromString(getMacString(cf, format), locale); } finally { cf.CFRelease(formatter); } }