Bluetooth getInputStream gets multiple/splitted Datapackages?
<p>i'm using the Infamous BluetoothChat-Example from Google to receive a ByteArray.
I know his length (55bytes), his Start Byte (0x69) and his End Byte (0x16) as well as the length of the data in the Array.</p>

<p>I'm quite sure that the Sender sends out 55 Bytes without any interruption but on the BluethootChat Example it looks like i receive multiple data packages.
The first package consists of 0x69 followed by 1023 times 0x00.
Then i receive the rest of the 55bytes.
This happens 70% of the time, sometimes the array get spiltted in the middle and sometimes the whole array is received complete.</p>

<p>Is this a normal Android-Bluetooth behavior </p>

<p>Thanks in advance...</p>

<pre><code>    private class ConnectedThread extends Thread {
    private final BluetoothSocket mmSocket;
    private final InputStream mmInStream;
    private final OutputStream mmOutStream;

    public ConnectedThread(BluetoothSocket socket) {
        Log.d(TAG, "create ConnectedThread");
        mmSocket = socket;
        InputStream tmpIn = null;
        OutputStream tmpOut = null;

        // Get the BluetoothSocket input and output streams
        try {
            tmpIn = socket.getInputStream();
            tmpOut = socket.getOutputStream();
        } catch (IOException e) {
            Log.e(TAG, "temp sockets not created", e);
        }

        mmInStream = tmpIn;
        mmOutStream = tmpOut;
    }

    public void run() {
        Log.i(TAG, "BEGIN mConnectedThread");
        byte[] buffer = new byte[1024];
        int bytes;

        // Keep listening to the InputStream while connected
        while (true) {
            try {
                // Read from the InputStream
                bytes = mmInStream.read(buffer);

                // Send the obtained bytes to the UI Activity
                mHandler.obtainMessage(BluetoothChat.MESSAGE_READ, bytes, -1, buffer)
                        .sendToTarget();
            } catch (IOException e) {
                Log.e(TAG, "disconnected", e);
                connectionLost();
                break;
            }
        }
    }
</code></pre>
