Skip to content
This repository has been archived by the owner on Feb 20, 2019. It is now read-only.

Examples do not show pickling to and from a file #5

Closed
d40cht opened this issue Jun 20, 2013 · 2 comments
Closed

Examples do not show pickling to and from a file #5

d40cht opened this issue Jun 20, 2013 · 2 comments

Comments

@d40cht
Copy link

d40cht commented Jun 20, 2013

I'd like to pickle an object which is in-memory resident at over 8Gb. I can't pickle this to a string - is there an interface to pickle directly to a file? If so, could we show it in the README?

@heathermiller
Copy link
Member

Hi there, thanks a lot for bringing this up. Apologies for the delay, been on the road nonstop since you reported this.

At the time that you wrote this, we had no direct support for pickling to a file. But I've just added that support. I've not tested it with anything as big as 8gb, though the newly added support seems to work for modestly-sized objects.

To give you a sample of what it looks like:

case class Person(name: String, nums: Array[Int])
val p = Person("James", (1 to 200).toArray)

val file = new File("test.json")
val fileOut = new TextFileOutput(file)

p.pickleTo(fileOut)

fileOut.close()

Could you let us know if that works for your use case? If not, if you run into any other issues, please don't hesitate to drop me a line, I'd be happy to help you support your use case. heather.miller@epfl.ch

@magicgoose
Copy link

Hmmm, what about binary formats? I couldn't find BinaryFileOutput or something similar.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants