Hello all,
could someone tell me if it's possible to convert bytes read from a filestream into int values to carry out some processing, then to convert back into bytes to read back to a file. What I have at the moment is a .txt file that I'm reading using FileInputStream. The data, which is read into a byte array, needs to be processed using an encoding algorithm i have built. My obvious problem is that data is read in in bytes but my algorithm requires integer values for processing. Rather than change the whole encoding prog I was hoping it wouldn't be too difficult to convert the bytes into ints - and vice versa. Is this an easy task or will I have to change the encoding/decoding prog.
could someone tell me if it's possible to convert bytes read from a filestream into int values to carry out some processing, then to convert back into bytes to read back to a file. What I have at the moment is a .txt file that I'm reading using FileInputStream. The data, which is read into a byte array, needs to be processed using an encoding algorithm i have built. My obvious problem is that data is read in in bytes but my algorithm requires integer values for processing. Rather than change the whole encoding prog I was hoping it wouldn't be too difficult to convert the bytes into ints - and vice versa. Is this an easy task or will I have to change the encoding/decoding prog.