0 Replies Latest reply on Oct 16, 2006 1:45 AM by Nafiganado

    Proper work with binary data

      I know that usually all manipulations with CF data are processed NOT in binary mode.
      However, how to make the following then:
      I create merger component, that would merge several files together and unmerge specific file from binary field. Client asked NOT to use zip, but make things simpler and faster and just merge several files together.
      So i've decided to use such format inside binary field
      [file_1_name, 256bytes][file_1_size, 4 bytes][file_1_body, <= 2^32 bytes]
      [file_N_name, 256bytes][file_N_size, 4 bytes][file_N_body, <= 2^32 bytes]

      So - i need to be able to write EXACTLY N bytes into some field. How do I accomplish this in CF? Indeed internally it seems to work with strings and makes binary conversion only in the end, with something like ToBinary() function...

      P.S. As 'savour' variant, I could try zip compression with level=0 :) Hope it's VERY fast.

      I will try to persuade client NOT to use something like this, but zip. However, I'd really like to hear the answer to my question - for understanding.