You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When working on serialization of some packets I tried to improve the interface to use some more generic methods (will post another pull request) I have stumbled upon the code for UShort (de)serialization.
fundeserializeUShort(buffer:ByteArray, offset:Int = 0): Int {
return (((buffer[offset].toInt() and0xFF) shl 8) or (buffer[offset +1].toInt() and0xFF))
}
For some reason these use usual Int as the input for the method instead of UShort which exists in the Kotlin stdlib. Is there any reasoning why the code does not follow the other examples? Types like UInt, ULong and UChar all use already existing types and that seems to be a weird exception.
The text was updated successfully, but these errors were encountered:
When working on serialization of some packets I tried to improve the interface to use some more generic methods (will post another pull request) I have stumbled upon the code for UShort (de)serialization.
kotlin-ipv8/ipv8/src/main/java/nl/tudelft/ipv8/messaging/Serialization.kt
Lines 36 to 45 in 476dc36
For some reason these use usual Int as the input for the method instead of UShort which exists in the Kotlin stdlib. Is there any reasoning why the code does not follow the other examples? Types like UInt, ULong and UChar all use already existing types and that seems to be a weird exception.
The text was updated successfully, but these errors were encountered: