@Test public void testNullEncoding () throws IOException { byte[] array = new byte[8]; InputStream inputStream = new ByteArrayInputStream(array); WebUtils.createString(inputStream, null); }
protected static String createString (InputStream in, String encoding) throws IOException { encoding = encoding == null ? "UTF-8" : encoding; ByteArrayOutputStream baos = new ByteArrayOutputStream(); byte[] buf = new byte[8192]; int len = 0; while ((len = in.read(buf)) != -1) { baos.write(buf, 0, len); } return new String(baos.toByteArray(), encoding); }
WebUtils { protected static String createString (InputStream in, String encoding) throws IOException { encoding = encoding == null ? "UTF-8" : encoding; ByteArrayOutputStream baos = new ByteArrayOutputStream(); byte[] buf = new byte[8192]; int len = 0; while ((len = in.read(buf)) != -1) { baos.write(buf, 0, len); } return new String(baos.toByteArray(), encoding); } }
WebUtils { protected static String createString (InputStream in, String encoding) throws IOException { encoding = encoding == null ? "UTF-8" : encoding; ByteArrayOutputStream baos = new ByteArrayOutputStream(); byte[] buf = new byte[8192]; int len = 0; while ((len = in.read(buf)) != -1) { baos.write(buf, 0, len); } return new String(baos.toByteArray(), encoding); } protected  WebUtils(); }
WebUtils { protected static String createString (InputStream in, String encoding) throws IOException { encoding = encoding == null ? "UTF-8" : encoding; ByteArrayOutputStream baos = new ByteArrayOutputStream(); byte[] buf = new byte[8192]; int len = 0; while ((len = in.read(buf)) != -1) { baos.write(buf, 0, len); } return new String(baos.toByteArray(), encoding); } protected  WebUtils(); static String readContentFromWebsite(String websiteURL); }
WebUtils { protected static String createString (InputStream in, String encoding) throws IOException { encoding = encoding == null ? "UTF-8" : encoding; ByteArrayOutputStream baos = new ByteArrayOutputStream(); byte[] buf = new byte[8192]; int len = 0; while ((len = in.read(buf)) != -1) { baos.write(buf, 0, len); } return new String(baos.toByteArray(), encoding); } protected  WebUtils(); static String readContentFromWebsite(String websiteURL);  }