I have a java console application which use jSerial library.
When I want to close Astream, before closing the serial port, I get the error:
java.lang.NegativeArraySizeException
at jssc.SerialNativeInterface.readBytes(Native Method)
at jssc.SerialPort.readBytes(SerialPort.java:421)
at anywheresoftware.b4j.serial.Serial$1.read(Serial.java:124)
at anywheresoftware.b4j.serial.Serial$1.read(Serial.java:116)
at anywheresoftware.b4a.randomaccessfile.AsyncStreams$AIN.run(AsyncStreams.java:184)
at java.lang.Thread.run(Thread.java:745)
java.lang.RuntimeException: java.lang.NegativeArraySizeException
at anywheresoftware.b4j.serial.Serial$1.read(Serial.java:129)
at anywheresoftware.b4j.serial.Serial$1.read(Serial.java:116)
at anywheresoftware.b4a.randomaccessfile.AsyncStreams$AIN.run(AsyncStreams.java:184)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.NegativeArraySizeException
at jssc.SerialNativeInterface.readBytes(Native Method)
at jssc.SerialPort.readBytes(SerialPort.java:421)
at anywheresoftware.b4j.serial.Serial$1.read(Serial.java:124)
... 3 more
This error does not affect in any way the functionality of the app, but is logged to the console too.
I have tried:
but the error is still logged in the console where the application runs.
What can I do to prevent this?
Dan
When I want to close Astream, before closing the serial port, I get the error:
java.lang.NegativeArraySizeException
at jssc.SerialNativeInterface.readBytes(Native Method)
at jssc.SerialPort.readBytes(SerialPort.java:421)
at anywheresoftware.b4j.serial.Serial$1.read(Serial.java:124)
at anywheresoftware.b4j.serial.Serial$1.read(Serial.java:116)
at anywheresoftware.b4a.randomaccessfile.AsyncStreams$AIN.run(AsyncStreams.java:184)
at java.lang.Thread.run(Thread.java:745)
java.lang.RuntimeException: java.lang.NegativeArraySizeException
at anywheresoftware.b4j.serial.Serial$1.read(Serial.java:129)
at anywheresoftware.b4j.serial.Serial$1.read(Serial.java:116)
at anywheresoftware.b4a.randomaccessfile.AsyncStreams$AIN.run(AsyncStreams.java:184)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.NegativeArraySizeException
at jssc.SerialNativeInterface.readBytes(Native Method)
at jssc.SerialPort.readBytes(SerialPort.java:421)
at anywheresoftware.b4j.serial.Serial$1.read(Serial.java:124)
... 3 more
This error does not affect in any way the functionality of the app, but is logged to the console too.
I have tried:
B4X:
Try
If Astream.IsInitialized Then Astream.Close
Catch
//do somthing
End Try
Serial1.Close
but the error is still logged in the console where the application runs.
What can I do to prevent this?
Dan