J2ME, InputStream freezes after receiving 40K data via Bluetooth

When sending data via bluetooth from a PC to my mobile phone (N73), the input stream seems to freeze. InputStream is obtained from StreamConnection.

PC software built on VB.net. Mobile in Java ME.

Does InputStream have an internal buffer that needs to be cleared when reading large chunks of data? Data is received in chunks with a range of 10Kb to 15Kb, and reading stops after receiving the third fragment. Oddly enough, I get no exceptions.

I looked at the API class documentation for the InputStream class and could not find any ClearStream InputStream method. There is only a reset () method, I don’t know what it was used for?

+3
source share
1 answer

InputStream.reset()is a method that you would call once after use Inpustream.mark()to force an InputStream to create an internal buffer that will allow you to read the same data several times, assuming InputStream supports it, returning true when called InputStream.markSupported().

Regarding the problem of data transfer, we are talking about a phone that runs Series60 3rd edition on top of Symbian OS 9.1. Given how extensive the Symbian test is for JSR-82, an implementation error as simple as the 40k limit for InputStream seems unlikely.

, ?
? ? , , InputStream bluetooth?

JSR-82, ​​ , N73: bluetooth , ( , MIDlet.startApp(), Canvas.keyPressed(), CommandListener.commandAction(), PlayerListener.playerUpdate()...).

bluetooth Thread.run(), .

+3

Source: https://habr.com/ru/post/1723218/


All Articles