i have a username and password login box when i send data to the socket its fine but when i print the same data from socket then extra bit is added a head of username. why is it so...please suggest
47pirates 9 Junior Poster in Training
Recommended Answers
Jump to Postthis is very little information to go on .. can you elaborate on the matter?
Jump to PostWhat do you mean by "bit"? In computer terminology a bit is 1/8 part of a byte.
It is hard to add a bit to a String. You can only work with bytes (8 bits).
Jump to PostAre you certain that you are using matching streams and encoding for the read and the write? Is the user name the very first thing sent over the socket?
Jump to PostCan i know what does stream matching mean
I'm just thinking if you do something like write a String via writeUTF to a DataOutputStream, then read it in as a simple String on an InputStream the you will probably see control characters etc at the start of the input.
All 15 Replies
stultuske 1,116 Posting Maven Featured Poster
NormR1 563 Posting Sage Team Colleague
stultuske commented: good point +14
47pirates 9 Junior Poster in Training
NormR1 563 Posting Sage Team Colleague
JamesCherrill 4,733 Most Valuable Poster Team Colleague Featured Poster
47pirates 9 Junior Poster in Training
NormR1 563 Posting Sage Team Colleague
47pirates 9 Junior Poster in Training
NormR1 563 Posting Sage Team Colleague
47pirates 9 Junior Poster in Training
JamesCherrill 4,733 Most Valuable Poster Team Colleague Featured Poster
DavidKroukamp 105 Master Poster Team Colleague Featured Poster
NormR1 563 Posting Sage Team Colleague
47pirates 9 Junior Poster in Training
JamesCherrill 4,733 Most Valuable Poster Team Colleague Featured Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.