mirror of
https://github.com/mik3y/usb-serial-for-android
synced 2025-06-07 16:06:10 +00:00
remove uncessary call to mWriteBuffer.position()
assigne len with mWriteBuffer.position() before testing
This commit is contained in:
parent
ef13784f4f
commit
b251430e02
@ -171,8 +171,8 @@ public class SerialInputOutputManager implements Runnable {
|
|||||||
// Handle outgoing data.
|
// Handle outgoing data.
|
||||||
byte[] outBuff = null;
|
byte[] outBuff = null;
|
||||||
synchronized (mWriteBuffer) {
|
synchronized (mWriteBuffer) {
|
||||||
if (mWriteBuffer.position() > 0) {
|
len = mWriteBuffer.position();
|
||||||
len = mWriteBuffer.position();
|
if (len > 0) {
|
||||||
outBuff = new byte[len];
|
outBuff = new byte[len];
|
||||||
mWriteBuffer.rewind();
|
mWriteBuffer.rewind();
|
||||||
mWriteBuffer.get(outBuff, 0, len);
|
mWriteBuffer.get(outBuff, 0, len);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user