Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / First Aid / June 2005

Tip: Looking for answers? Try searching our database.

Image processing/rendering problem

Thread view: 
asn - 22 Jun 2005 12:29 GMT
Hello,
I have two applications working in a client/server mode. The client is
written in C++ running on a Linux box. The server is an applet and was
written on a Linux box with NetBeans 3.6.
When the client send a message, which is a string, containing some
information plus a image (JPEG format) I can decode evrything and
display the image on a Linux box running the applet (I'm using
Firefox).
But when I use a machine running Windows the image looks corrupted
(with IE or Firefox). It's strange since the data are the same (Java is
suppose to be cross platform). I read a document about the charsets but
I don't know how should I apply it. Which are the charsets available on
windows and which one should I apply? Should I applly the one use by
the client machine (running on the Linux box)?

Anybody have an idea?

Here is a snapshot of the code to get the image out of the string on
the server:

<--------------- Start here -------------------------->

String strdata = m_inputStream.readLine();

String str1 = strdata.replaceAll("firstReplacement","\n");
String str2 = str1.replaceAll("secondReplacement","\r");
String str3 = str2.replaceAll("thirdReplacement","\r\n");

byte data[] = str3.getBytes();

<--------------- end here -------------------------->

When using the getBytes() should I specify the the charsets.

Thanks for your help,
Best regards.
Alain-Serge
Boudewijn Dijkstra - 22 Jun 2005 17:31 GMT
> When using the getBytes() should I specify the the charsets.

Have you tried that?
asn - 22 Jun 2005 23:27 GMT
No yet. Before going in that I would to know if is to good path.
Boudewijn Dijkstra - 25 Jun 2005 14:20 GMT
> No yet. Before going in that I would to know if is to good path.

There's nothing wrong with trying something out.  And getBytes() is known to
be platform-sensitive.


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.