I'm writing an extension in c that will take a string of space delimited
ascii like: "param1=value1 param2=value2 ...".

The c side function will produce some binary encoded data that will vary
in length based on the input string.  The length will be known on the c
side after encoding.  What is the best way to pass this buffer of raw
data back to ruby so it knows the length and doesn't alter the data in
any way?  All ruby will need to do with it is write it to a socket then
as raw bytes knowing the length...

I see there is rb_str_new2(char*) but the data is not null terminated on
the c side so I'm hesitant to use that conversion function.

thanks,

Kape

-- 
Posted via http://www.ruby-forum.com/.