java - How to Convert InputStream.read(new byte[1024]); to String? -
I would like to get data from My code is piece My data has been sent from Bluetooth to the above code piece only (like 2 if I sent hi, 5 starts if sent), then send me normal from sender Will have to go back like string. I only changed the string in Finally, I can solve it! InputStream.read (buffer); Only how many bytes are in the buffer, and return the integer number of socket data stored in the buffer. So, with buffer you get the string eg String result = new string (buffer); InputStream () as a code Hi, start, stop , e.t.c.
byte [] buffer = new byte [1024]; InputStream.read (buffer); InputStream . Any suggestions, I appreciate it!
Comments
Post a Comment