diff --git a/src/hdskins/java/com/voxelmodpack/hdskins/util/MoreHttpResponses.java b/src/hdskins/java/com/voxelmodpack/hdskins/util/MoreHttpResponses.java index 22502be8..2246331d 100644 --- a/src/hdskins/java/com/voxelmodpack/hdskins/util/MoreHttpResponses.java +++ b/src/hdskins/java/com/voxelmodpack/hdskins/util/MoreHttpResponses.java @@ -1,5 +1,6 @@ package com.voxelmodpack.hdskins.util; +import com.google.common.io.ByteStreams; import com.google.common.io.CharStreams; import com.google.gson.JsonObject; import com.voxelmodpack.hdskins.server.SkinServer; @@ -48,6 +49,12 @@ public interface MoreHttpResponses extends AutoCloseable { return new BufferedReader(new InputStreamReader(getInputStream(), StandardCharsets.UTF_8)); } + default byte[] bytes() throws IOException { + try (InputStream input = getInputStream()) { + return ByteStreams.toByteArray(input); + } + } + default String text() throws IOException { try (BufferedReader reader = getReader()) { return CharStreams.toString(reader);