Hi Justin, you are correct with your assumption. However as soon as at least one floating point number is used in the equation, the result should be too, so it should be enough to make 8 an 8.0
And no, size in bits is a Boolean and it simply provides information on if the size parameter is the number of bytes (false) or the number of bits (true). And no, if I want to read 3 consecutive bits for example, then we have to transport this in 1 byte, if we read 9 bits, then in 2 and so on. Chris Am 08.01.18, 04:24 schrieb "Justin Mclean" <[email protected]>: Hi, With this change here: > DataTransportSize dataTransportSize = DataTransportSize.valueOf(userData.readByte()); > short length = (dataTransportSize.isSizeInBits()) ? > - (short) Math.ceil(userData.readShort() / 8) : userData.readShort(); > + (short) (userData.readShort() / 8) : userData.readShort(); Math.ceil would never round up as a short divided by an init is never a floating point number. Do we need to worry about non byte boundaries? i.e. is isSizeInBits always multiple of 8? If not the code will need to be modified as it would still be doing what it was doing before and sometimes missing a byte. Thanks, Justin
