[Rd] Serializing many small objects efficiently

From: Antonio Piccolboni <antonio_at_piccolboni.info>
Date: Thu, 22 Mar 2012 09:34:00 -0700

sorry if this question is trivial or unclear, this is my first venture into mixed C/R programming (I am reasonably experienced in each separately). I am trying to write a serialization function for a format called typedbytes, which is used as an interchange format in Hadoop circles. Since I would need to serialize according to the internal R format many small R objects I looked at the c interface

void R_Serialize(SEXP s, R_outpstream_t ops); SEXP R_Unserialize(R_inpstream_t ips);

If I look at the source for e.g. unserialize is see a

 .Call("R_unserialize", connection, refhook, PACKAGE = "base")

which, despite the name of the second argument, accepts as 'connection' a raw vector. Is there any way to call that function from C -- without calling the R function? Failing that, from what I've read I gather that it is not possible to get a C stream from a connection, so unless I am wrong using R_serialize directly is not possible. If all else fails I would have probably to use a hack requiring knowledge of the serialization format, which I'd much rather avoid. Suggestions? Thanks


        [[alternative HTML version deleted]]

R-devel_at_r-project.org mailing list

https://stat.ethz.ch/mailman/listinfo/r-devel Received on Thu 22 Mar 2012 - 21:43:08 GMT

This quarter's messages: by month, or sorted: [ by date ] [ by thread ] [ by subject ] [ by author ]

All messages

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Fri 23 Mar 2012 - 11:30:32 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-devel. Please read the posting guide before posting to the list.

list of date sections of archive