Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

I have several input formats mostly restricted to geotiff and some proprietary binary formats. I import them into my program and then need to export them into various other data formats (also binary) but as two dimensional arrays.

Currently I hold the data after importing them into my program as a byte array. I also need to perform search and replace on element of this data. Is the byte array the best data structure for this sort of application ?

Summary - all of my input formats are binary(geotiff and proprietary) and all of my export formats are binary(two dimensional arrays). In between import and export I need to do some search and replace. Is byte array the best data structure for this sort of application ?

share|improve this question
    
Are you searching and replacing byte sequences, or something different? Without knowing that, it's impossible to tell. –  Kilian Foth Feb 16 at 7:46
    
@KilianFoth - I search and replace byte sequences. –  gansub Feb 16 at 7:47
1  
Then holding bytes in memory is a reasonable thing to do. (If you need to replace sequences with sequences of a different length, then an array may be less workable than a dynamic data structure, though.) –  Kilian Foth Feb 16 at 7:49
    
@KilianFoth - replaced sequences are also of same length. So shall I delete my question or leave it ? Since it looks like you answered it. –  gansub Feb 16 at 7:50
1  
It's perfectly permissible to answer your own question and even to accept it. Why not try it out? The point if this site is to generate a repo of valuable answers, not to boost anyone's ego. –  Kilian Foth Feb 16 at 8:02

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.