i reading stream using inputstream. code below
buffer = new byte[8]; try { while (inputstream.available() > 0) { int numbytes = inputstream.read(buffer); system.out.println(new string(buffer, 0, numbytes)); } } catch (exception ex) { ex.printstacktrace(); } but instead of getting characters getting below

what these , how can actual characters.
you need supply appropriate character set argument string constructor. (that's 4th argument - missing in code - , has wrong default data.)
otherwise string misinterpret data.
you may find that
java.nio.charset.charset.forname("utf-8")
is 1 need.
Comments
Post a Comment