File tree Expand file tree Collapse file tree 2 files changed +16
-0
lines changed
main/java/org/msgpack/core
test/scala/org/msgpack/core Expand file tree Collapse file tree 2 files changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -1735,6 +1735,7 @@ private int readNextLength32()
17351735 public void close ()
17361736 throws IOException
17371737 {
1738+ totalReadBytes += position ;
17381739 buffer = EMPTY_BUFFER ;
17391740 position = 0 ;
17401741 in .close ();
Original file line number Diff line number Diff line change @@ -254,6 +254,9 @@ class MessageUnpackerTest extends AirSpec with Benchmark {
254254 }
255255 count shouldBe 6
256256 unpacker.getTotalReadBytes shouldBe arr.length
257+
258+ unpacker.close()
259+ unpacker.getTotalReadBytes shouldBe arr.length
257260 }
258261 }
259262
@@ -268,6 +271,9 @@ class MessageUnpackerTest extends AirSpec with Benchmark {
268271
269272 skipCount shouldBe 2
270273 unpacker.getTotalReadBytes shouldBe testData.length
274+
275+ unpacker.close()
276+ unpacker.getTotalReadBytes shouldBe testData.length
271277 }
272278 }
273279
@@ -322,6 +328,9 @@ class MessageUnpackerTest extends AirSpec with Benchmark {
322328
323329 ib.result() shouldBe intSeq.toSeq
324330 unpacker.getTotalReadBytes shouldBe testData2.length
331+
332+ unpacker.close()
333+ unpacker.getTotalReadBytes shouldBe testData2.length
325334 }
326335 }
327336
@@ -352,6 +361,9 @@ class MessageUnpackerTest extends AirSpec with Benchmark {
352361 }
353362 count shouldBe numElems
354363 unpacker.getTotalReadBytes shouldBe data.length
364+
365+ unpacker.close()
366+ unpacker.getTotalReadBytes shouldBe data.length
355367 }
356368 }
357369 }
@@ -869,6 +881,9 @@ class MessageUnpackerTest extends AirSpec with Benchmark {
869881 unpacker.unpackInt shouldBe 1
870882
871883 unpacker.getTotalReadBytes shouldBe arr.length
884+
885+ unpacker.close()
886+ unpacker.getTotalReadBytes shouldBe arr.length
872887 }
873888 }
874889 }
You can’t perform that action at this time.
0 commit comments