Click to See Complete Forum and Search --> : Reading Files


Kiran B.
October 8th, 1999, 06:49 AM
Hi
I was trying to read a .jpg file and writing it into some another file. But the file contents differed. When I tried to find out what went wrong i found that all the characters with values 128 and more are written char 63. What is the problem. How can i overcome this.
Actually i am reading one byte at a time and storing in a stringbuffer. when the size becomes 4096 i will write the buffer by getting the bytes in it.

Please help

Kiran Kumar B.

unicman
October 10th, 1999, 12:54 PM
U can't use strings to store byte array.

If u want to do binary transfer either from file to file, or computer to computer. U should use byte and not strings.

JPG is considered binary file, as it can contain anything (in one byte).

Instead use byte array with 4096 size.

- UnicMan
http://members.tripod.com/unicman