I am in a design phase of an editor project. I always store files in binary format. However the requirement is, user must be able to click a button "Display Format" and the format of the file content should change from Binary to Hex, Decimal and vice-versa. What is the best way to do this? My files are really huge ones.
            Asked
            
        
        
            Active
            
        
            Viewed 793 times
        
    0
            
            
        - 
                    1possible duplicate of [How do you convert Byte Array to Hexadecimal String, and vice versa?](http://stackoverflow.com/questions/311165/how-do-you-convert-byte-array-to-hexadecimal-string-and-vice-versa) – Alexei Levenkov Apr 25 '14 at 01:28
1 Answers
0
            I would not read the file into memory but instead just keep an eye on where the offset of the top left corner of your editor is. Then just use random file access using Stream.Seek and to read that part of the file when needed and display it to the end user.
The actual conversion from hex, binary and octal is easy and the System.Convert.ToString(byte, int) is your friend here.
 
    
    
        HenrikJohnson
        
- 159
- 6
 
    