File tree Expand file tree Collapse file tree 1 file changed +19
-1
lines changed
msgpack-core/src/test/scala/org/msgpack/core Expand file tree Collapse file tree 1 file changed +19
-1
lines changed Original file line number Diff line number Diff line change @@ -149,7 +149,7 @@ class MessageUnpackerTest extends MessagePackSpec {
149149 val mapLen = unpacker.unpackMapHeader()
150150 debug(s " map size: $mapLen" )
151151 case ValueType .INTEGER =>
152- val i = unpacker.unpackInt ()
152+ val i = unpacker.unpackLong ()
153153 debug(s " int value: $i" )
154154 case ValueType .STRING =>
155155 val s = unpacker.unpackString()
@@ -301,6 +301,24 @@ class MessageUnpackerTest extends MessagePackSpec {
301301
302302 }
303303
304+ " read numeric data at buffer boundary" taggedAs(" boundary2" ) in {
305+ val out = new ByteArrayOutputStream
306+ val packer = MessagePack .newDefaultPacker(out)
307+ (0 until 1170 ).foreach{i =>
308+ packer.packLong(0x0011223344556677L)
309+ packer.packString(" hello" )
310+ }
311+ packer.close
312+ val data = out.toByteArray
313+
314+ val unpacker = new MessageUnpacker (new InputStreamBufferInput (new ByteArrayInputStream (data), 8192 ))
315+ (0 until 1170 ).foreach { i =>
316+ unpacker.unpackLong() shouldBe 0x0011223344556677L
317+ unpacker.unpackString() shouldBe " hello"
318+ }
319+ unpacker.close()
320+ }
321+
304322 " be faster then msgpack-v6 skip" taggedAs (" cmp-skip" ) in {
305323
306324 val data = testData3(10000 )
You can’t perform that action at this time.
0 commit comments