Skip to content
Snippets Groups Projects
Commit 01f1d274 authored by OZGCloud's avatar OZGCloud
Browse files

cleanup - do not throw checked exception

parent 7c381a3e
Branches
Tags
No related merge requests found
...@@ -64,9 +64,13 @@ public class TestUtils { ...@@ -64,9 +64,13 @@ public class TestUtils {
return Objects.isNull(str) ? "null" : String.format("\"%s\"", str); return Objects.isNull(str) ? "null" : String.format("\"%s\"", str);
} }
public static byte[] contentStreamToByteArray(InputStream contentStream) throws IOException { public static byte[] contentStreamToByteArray(InputStream contentStream) {
var outputStream = new ByteArrayOutputStream(); var outputStream = new ByteArrayOutputStream();
try {
IOUtils.copy(contentStream, outputStream); IOUtils.copy(contentStream, outputStream);
} catch (IOException e) {
throw new RuntimeException("Error on reading stream", e);
}
return outputStream.toByteArray(); return outputStream.toByteArray();
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment