packing large array of mixed native types

K

keithroe

I have an array in the form [ uchar, float, float, float, uchar,
float, float, float, .... ]
I know I can pack it like this:
my_array.pack( "CFFFCFFFCFFF...." )
but then I have to create a string with as many elements as the array
I am packing,
which can be quite large. Is there a way to abbreviate this string
(eg, somethign like
my_array.pack( '(CFFF)*' ) ?

Thanks
 
W

Waldemar Dick

Hi,

Am 26.01.2011 21:10, schrieb (e-mail address removed):
I have an array in the form [ uchar, float, float, float, uchar,
float, float, float, .... ]
I know I can pack it like this:
my_array.pack( "CFFFCFFFCFFF...." )
but then I have to create a string with as many elements as the array
I am packing,
which can be quite large. Is there a way to abbreviate this string
(eg, somethign like
my_array.pack( '(CFFF)*' ) ?

Why don't you read 4 elements at a time, pack them and write them in an
output buffer in a loop?

Just a thought.

Greetings

Waldemar
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,013
Latest member
KatriceSwa

Latest Threads

Top