Add xitrum.util.Loader.bytesToFile method to write to file #466

Closed
ngocdaothanh opened this Issue Sep 28, 2014 · 0 comments

Projects

None yet

1 participant

@ngocdaothanh
Member

If you want to serialize an object to a file:

import xitrum.util.{Loader, SeriDeseri}

val bytes = SeriDeseri.toBytes(myObject)
Loader.bytesToFile(bytes, "myObject.bin")

Then later deserialize from it:

val bytes    = Loader.bytesFromFile("myObject.bin")
val myObject = SeriDeseri.fromBytes[MyObject](bytes)
@ngocdaothanh ngocdaothanh self-assigned this Sep 28, 2014
@ngocdaothanh ngocdaothanh added this to the Xitrum 3.19 milestone Sep 28, 2014
@ngocdaothanh ngocdaothanh changed the title from Add utility method to serialize/deserialize to/from file to Add xitrum.util.Loader.bytesToFile method to write to file Sep 30, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment