File -> Binary
I was playing around with XOR encryption, (not for practical use, just playing with it) and I was wondering if there was a reasonable way to access the binary code of a file in Java. I realize for a text file I could use a char array and get the ascii value, convert to base 2, yada yada.. but I was hoping there was a better way for a wider variety of file types.
Can't you open it as a FileInputStream, check its available noOf bytes,
make yourself a byte array of that size and read the file into that array ?
Last edited by sjalle; 03-15-2005 at 08:10 AM.
hm.. makes sense. I'll check that out later toda. Thanx
-- Android Development Center
-- Cloud Development Project Center
-- HTML5 Development Center
-- Windows Mobile Development Center