public static void serializeObjectsToFile(final File file, final Object... objects) { checkNotNull(objects, "Precondition violation - argument 'objects' must not be NULL!"); checkNotNull(file, "Precondition violation - argument 'file' must not be NULL!"); checkArgument(file.exists(), "Precondition violation - argument 'file' must refer to an existing file!"); checkArgument(file.isFile(), "Precondition violation - argument 'file' must refer to a file (not a directory)!"); checkArgument(file.canWrite(), "Precondition violation - argument 'file' must be writable!"); try { getKryo().serializeToFile(file, objects); } catch (IOException e) { throw new ChronosIOException("Failed to serialize object to file!", e); } }