@Override
	public boolean merge(@NonNull final DataStream output, @Nullable final byte[] lastPacket, final int index) {
		output.write(lastPacket);

		buffer += new String(lastPacket);
		try {
			new JSONObject(buffer);
		} catch (final JSONException e) {
			try {
				new JSONArray(buffer);
			} catch (final JSONException jsonException) {
				return false;
			}
		}
		reset();
		return true;
	}
A data merger object that returns true when complete JSON has been received.
<p>
It will consume packets until the JSON object can be created.
ble/src/main/java/no/nordicsemi/android/ble/data/JsonMerger.java