From 6f1837a46ffa961b8ab18a0bb8abbcd48ca51b88 Mon Sep 17 00:00:00 2001 From: Matthew Messinger Date: Tue, 7 Aug 2018 20:15:55 -0400 Subject: [PATCH] MoreHttpResponses : use getReader() more --- .../com/voxelmodpack/hdskins/skins/MoreHttpResponses.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/hdskins/java/com/voxelmodpack/hdskins/skins/MoreHttpResponses.java b/src/hdskins/java/com/voxelmodpack/hdskins/skins/MoreHttpResponses.java index 3b7be207..52a56b86 100644 --- a/src/hdskins/java/com/voxelmodpack/hdskins/skins/MoreHttpResponses.java +++ b/src/hdskins/java/com/voxelmodpack/hdskins/skins/MoreHttpResponses.java @@ -10,7 +10,6 @@ import java.io.BufferedReader; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; -import java.io.Reader; import java.lang.reflect.Type; import java.nio.charset.StandardCharsets; import java.util.stream.Stream; @@ -52,13 +51,13 @@ public interface MoreHttpResponses extends AutoCloseable { } default T json(Class type) throws IOException { - try (Reader reader = new InputStreamReader(getResponse().getEntity().getContent())) { + try (BufferedReader reader = getReader()) { return SkinServer.gson.fromJson(reader, type); } } default T json(Type type) throws IOException { - try (Reader reader = new InputStreamReader(getResponse().getEntity().getContent())) { + try (BufferedReader reader = getReader()) { return SkinServer.gson.fromJson(reader, type); } }