Hi again @akornilov82.
I’ve forked - for test purposes - and removed the nativeByteOrder
from the method call, but I’ve now realized the situation is even more broken than expected.
Since you handle everything either as a long, when you perform the actual write you write an entire long in BE/LE which is the cumulation of the bytes received so far, but this is wrong.
From an API point of view, I should be able to write as BE/LE a single data type and not their cumulation to long.
For example (in BE):
Given:
val a: UShort = 1u
val b: UShort = 2u
obs.writeUShort(a)
obs.writeUShort(b)
Expected result:
[0, 1, 0, 2]
Result got:
[0, 2, 0, 1]