I have to send a gif from a client to server.
I have used sockets and DataInputStream and PrintWriter to stream the data.
The problem is that the server recives incorect data; a few bytes are not recognized.This is the source gif sent by the client:
//****************************************
GIF89a2 2 ³ RPPÅÄÄ}||·¶¶ÔÓÓ`^^¨§§&$$522ââ⌊ŠCAAommš˜˜ÿÿÿ!ù , 2 2 ðÉI«½8ëÍ»ÿ`(Ždižhª®lë¾p,Ïtmßx®ï|ïÿÀ pH,?Èaá<Š\!? €PÚ€P rÄà Dw‡†•HœqЊÁ &S|8
w7 t‹I”•–—˜™ ;
//****************************************
And this is what the server recives:
//***************************************
GIF89a2 2 ³ RPPÅÄÄ}||·¶¶ÔÓÓ`^^¨§§&$$522âââ???CAAomm???ÿÿÿ!ù , 2 2 ðÉI«½8ëÍ»ÿ`(?di?hª®lë¾p,Ïtmßx®ï|ïÿÀ pH,?Èaá<?\!? ?PÚ?P rÄà Dw???H?qÐ?Á &S|8
w7 t?I?????? ;
//***************************************
Notice the last bytes from the recived transmision: t?I?????? .
Please tell me why is this happening. Should i send the data using byte transmision instead of the PrintWriter.println() method?
Thanks in advance.
I have used sockets and DataInputStream and PrintWriter to stream the data.
The problem is that the server recives incorect data; a few bytes are not recognized.This is the source gif sent by the client:
//****************************************
GIF89a2 2 ³ RPPÅÄÄ}||·¶¶ÔÓÓ`^^¨§§&$$522ââ⌊ŠCAAommš˜˜ÿÿÿ!ù , 2 2 ðÉI«½8ëÍ»ÿ`(Ždižhª®lë¾p,Ïtmßx®ï|ïÿÀ pH,?Èaá<Š\!? €PÚ€P rÄà Dw‡†•HœqЊÁ &S|8
w7 t‹I”•–—˜™ ;
//****************************************
And this is what the server recives:
//***************************************
GIF89a2 2 ³ RPPÅÄÄ}||·¶¶ÔÓÓ`^^¨§§&$$522âââ???CAAomm???ÿÿÿ!ù , 2 2 ðÉI«½8ëÍ»ÿ`(?di?hª®lë¾p,Ïtmßx®ï|ïÿÀ pH,?Èaá<?\!? ?PÚ?P rÄà Dw???H?qÐ?Á &S|8
w7 t?I?????? ;
//***************************************
Notice the last bytes from the recived transmision: t?I?????? .
Please tell me why is this happening. Should i send the data using byte transmision instead of the PrintWriter.println() method?
Thanks in advance.