sam
03/11/2019, 10:34 PMinit {
"ByteArray.getShort/putShort" {
should("parse the short correctly") {
val (buf, expectedShort) = byteArrayOf(0x00, 0x00) to 0.toShort()
buf.getShort(0) shouldBe expectedShort
val array = ByteArray(2)
array.putShort(0, expectedShort)
array[0] = 0x42
array should haveSameContentAs(buf)
}
}
}