The Artima Developer Community
Sponsored Link

Legacy Java Answers Forum
August 2001

Advertisement

Advertisement

This page contains an archived post to the Java Answers Forum made prior to February 25, 2002. If you wish to participate in discussions, please visit the new Artima Forums.

Message:

Help on string sending over socket

Posted by Nacho on August 17, 2001 at 3:12 PM

Hello:

I'm trying to send over a serversocket (a socket, printwriter) a string. The string is the result of base64encoding. This conversion is done to translate UTF8 string into something that every computer can understand (sic). Well, actually, I'm encoding the results of a cipher (cryptographic java class) but this only matters, because it produces very strange strings output, plenty of rare characters. [StrangeString] ==> [baseEncode64] --> Over socket --> [decodeBase64] ==> [StrangeString]

My intention is blocked because for some reason (perhaps windows jvm coding ? ) when the length of a line is over 76 (base64 stablishes the maximum length in 76, so I had to remove from the complete string the \n, to put it in an acceptable form to socket printLine()) the process fails.
A too long string is the cause for the output on the server to be different from the client input. And as you can suppose is necessary not to modify the ciphered string to get again the decoded string ;)

I'm absolutly desperado, so if you can send me or answer my question would be very nice.

Thanks in advance. Nacho.



Replies:

Sponsored Links



Google
  Web Artima.com   
Copyright © 1996-2009 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use - Advertise with Us