Add ByteBufUtils.writeUint{8,16,32,64} 63/94463/1
authorRobert Varga <robert.varga@pantheon.tech>
Mon, 4 Jan 2021 13:32:29 +0000 (14:32 +0100)
committerRobert Varga <robert.varga@pantheon.tech>
Thu, 7 Jan 2021 10:16:47 +0000 (11:16 +0100)
commited801a4f2e8eec4797706ca3fd1133e2ddbde1d8
tree7b741491c387cf86728152d4d2b7f444c30f7a99
parentd7c5445aed883d82df2e13240c7ff94e32bc3776
Add ByteBufUtils.writeUint{8,16,32,64}

Plain ByteBufUtils.write() methods are hiding the width argument,
hence can potentially break binary encodings on type change.

Add explicit methods, so that the intent is documented and actually
breaks when incorrect type is applied.

Change-Id: I26e14048b4d4d44ea5044ff852650b18ca90012f
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit e9bae1b48acf842fade92b5bcaf9e69b38b02c32)
(cherry picked from commit eb34ba3ef1d9f0f7cf724bdf2c3ed57943a40e8b)
yang/yang-common-netty/src/main/java/org/opendaylight/yangtools/yang/common/netty/ByteBufUtils.java