public static <T> T deepCopy(final T element) { return getKryo().deepCopy(element); }
public static <T> T deserialize(final byte[] serialForm) { return getKryo().deserialize(serialForm); }
public static byte[] serialize(final Object object) { return getKryo().serialize(object); }
public static List<Object> deserializeObjectsFromFile(final File file) { 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.canRead(), "Precondition violation - argument 'file' must be readable!"); try { return getKryo().deserializeObjectsFromFile(file); } catch (IOException e) { throw new ChronosIOException("Failed to deserialize object(s) from file!", e); } }
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); } }
public static <T> T deserializeObjectFromFile(final File file) { 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.canRead(), "Precondition violation - argument 'file' must be readable!"); try { return getKryo().deserializeObjectFromFile(file); } catch (IOException e) { throw new ChronosIOException("Failed to deserialize object from file!", e); } }