IntelliJ Java IDE
The moose likes I/O and Streams and the fly likes Bluetooth blues (stream related I believe) Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » I/O and Streams
Reply Bookmark "Bluetooth blues (stream related I believe)" Watch "Bluetooth blues (stream related I believe)" New topic
Author

Bluetooth blues (stream related I believe)

Darrin Smith
Ranch Hand

Joined: Aug 04, 2003
Posts: 271
I have instances where I seem to be missing header information sent to me over a Bluetooth data stream. I am also wondering if I am getting all of the data or not (truncating before the end).

My app is based off of the BluettothChat application for Android. Here is the code I am wondering about:





Now to me, this LOOKS like it could miss data since it never checks for a -1 that I understand indicates when the end the stream has been reached.

Anyone have an idea based on this code (which again, comes from Google's BluetoothChat example app) might not get the beginning bytes of a stream on occasion and also, if it looks like it will get all of the stream given it never checks for the end of it.

Thanks!!!



 
IntelliJ Java IDE
 
subject: Bluetooth blues (stream related I believe)
 
Threads others viewed
can i call two threads at the same time
regarding peer to peer network through java
OutOfMemoryError... Whats the solution?
How to Change the File Name for Each Uploaded Files to the Socket Server?
Barcode reading using a blue tooth scanner
jQuery in Action, 2nd edition