Pergunta

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.

Foi útil?

Solução

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.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top