@@ -719,7 +719,8 @@ public String[] getConsole(int lines) throws APIUnauthorizedException, IOExcepti
719719 }
720720
721721 //get the JSON array from the object
722- JSONArray consoleJsonArray = new JSONArray (conn .getInputStream ());
722+ InputStreamReader reader = new InputStreamReader (conn .getInputStream ());
723+ JSONArray consoleJsonArray = new JSONArray (new JSONTokener (reader ));
723724
724725 //Create a string array to store the console
725726 String [] console = new String [consoleJsonArray .length ()];
@@ -781,7 +782,8 @@ public String[] getConsoleFromBeginning(int lines, boolean takeFromBeginning) th
781782 }
782783
783784 //get the JSON array from the object
784- JSONArray consoleJsonArray = new JSONArray (conn .getInputStream ());
785+ InputStreamReader reader = new InputStreamReader (conn .getInputStream ());
786+ JSONArray consoleJsonArray = new JSONArray (new JSONTokener (reader ));
785787
786788 //Create a string array to store the console
787789 String [] console = new String [consoleJsonArray .length ()];
@@ -843,7 +845,8 @@ public String[] getConsoleReversed(int lines, boolean reversed) throws APIUnauth
843845 }
844846
845847 //get the JSON array from the object
846- JSONArray consoleJsonArray = new JSONArray (conn .getInputStream ());
848+ InputStreamReader reader = new InputStreamReader (conn .getInputStream ());
849+ JSONArray consoleJsonArray = new JSONArray (new JSONTokener (reader ));
847850
848851 //Create a string array to store the console
849852 String [] console = new String [consoleJsonArray .length ()];
@@ -908,7 +911,8 @@ public String[] getConsole(int lines, boolean takeFromBeginning, boolean reverse
908911 }
909912
910913 //get the JSON array from the object
911- JSONArray consoleJsonArray = new JSONArray (conn .getInputStream ());
914+ InputStreamReader reader = new InputStreamReader (conn .getInputStream ());
915+ JSONArray consoleJsonArray = new JSONArray (new JSONTokener (reader ));
912916
913917 //Create a string array to store the console
914918 String [] console = new String [consoleJsonArray .length ()];
0 commit comments