The C# code has corrected this error. The Java code needs to allow the user to enter the Data length field as the current method uses a one byte chunk to determine length, which overrides any user input.
For marshal method C# used:
dos.writeShort((short)((_dataLength == 0 && _data.Length > 0) ? _data.Length * 8 : _dataLength)); //If dataLength is zero then default to every byte will use all 8 bits (where _data is the actual signal data).
For Unmarshal:
_data = dis.readByteArray((_dataLength / 8) + (_dataLength % 8 > 0 ? 1 : 0)); //Needed to convert from bits to bytes and checks for odd number of bits
Peter
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
The C# code has corrected this error. The Java code needs to allow the user to enter the Data length field as the current method uses a one byte chunk to determine length, which overrides any user input.
For marshal method C# used:
dos.writeShort((short)((_dataLength == 0 && _data.Length > 0) ? _data.Length * 8 : _dataLength)); //If dataLength is zero then default to every byte will use all 8 bits (where _data is the actual signal data).
For Unmarshal:
_data = dis.readByteArray((_dataLength / 8) + (_dataLength % 8 > 0 ? 1 : 0)); //Needed to convert from bits to bytes and checks for odd number of bits
Peter
This is in reference to the C++ code
Yes, understood. Just outlining what needed to be done to correct the problem as i believe it also is a problem with the Java code.