Reading multiple Python pickled data at once, buffering and newlines?
问题 to give you context: I have a large file f , several Gigs in size. It contains consecutive pickles of different object that were generated by running for obj in objs: cPickle.dump(obj, f) I want to take advantage of buffering when reading this file. What I want, is to read several picked objects into a buffer at a time. What is the best way of doing this? I want an analogue of readlines(buffsize) for pickled data. In fact if the picked data is indeed newline delimited one could use readlines,