From b0458aa412d28fa7c594ab3de846cdd023c51c09 Mon Sep 17 00:00:00 2001 From: Arthur Chan Date: Wed, 27 Dec 2023 13:29:00 +0000 Subject: [PATCH] Fix for Java 8 Signed-off-by: Arthur Chan --- .../dataformat/ion/fuzz/Fuzz434_65268_65274_NPETest.java | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/ion/src/test/java/com/fasterxml/jackson/dataformat/ion/fuzz/Fuzz434_65268_65274_NPETest.java b/ion/src/test/java/com/fasterxml/jackson/dataformat/ion/fuzz/Fuzz434_65268_65274_NPETest.java index 950e8084c..8373a3eac 100644 --- a/ion/src/test/java/com/fasterxml/jackson/dataformat/ion/fuzz/Fuzz434_65268_65274_NPETest.java +++ b/ion/src/test/java/com/fasterxml/jackson/dataformat/ion/fuzz/Fuzz434_65268_65274_NPETest.java @@ -1,6 +1,6 @@ package com.fasterxml.jackson.dataformat.ion.fuzz; -import java.io.InputStream; +import java.io.*; import org.hamcrest.Matchers; import org.junit.Test; @@ -15,9 +15,6 @@ import static org.junit.Assert.assertEquals; import static org.junit.Assert.fail; -import java.io.*; -import java.nio.file.*; - // [dataformats-binary#434 public class Fuzz434_65268_65274_NPETest { @@ -48,7 +45,8 @@ public void testFuzz65274() throws Exception { .build(); try (InputStream in = getClass().getResourceAsStream("/data/fuzz-65274.ion")) { - byte[] invalid = in.readAllBytes(); + byte[] invalid = new byte[in.available()]; + new DataInputStream(in).readFully(invalid); try (JsonParser p = MAPPER.getFactory().createParser(new ByteArrayInputStream(invalid))) { MAPPER.readTree(p); }