@Test public void testToString() throws Exception { byte[] b = "testToString".getBytes(RemotingHelper.DEFAULT_CHARSET); InputStream is = new ByteArrayInputStream(b); String str = IOTinyUtils.toString(is, null); assertEquals("testToString", str); is = new ByteArrayInputStream(b); str = IOTinyUtils.toString(is, RemotingHelper.DEFAULT_CHARSET); assertEquals("testToString", str); is = new ByteArrayInputStream(b); Reader isr = new InputStreamReader(is, RemotingHelper.DEFAULT_CHARSET); str = IOTinyUtils.toString(isr); assertEquals("testToString", str); }
static public String toString(InputStream input, String encoding) throws IOException { return (null == encoding) ? toString(new InputStreamReader(input, RemotingHelper.DEFAULT_CHARSET)) : toString(new InputStreamReader( input, encoding)); }
IOTinyUtils { static public String toString(InputStream input, String encoding) throws IOException { return (null == encoding) ? toString(new InputStreamReader(input, RemotingHelper.DEFAULT_CHARSET)) : toString(new InputStreamReader( input, encoding)); } }
IOTinyUtils { static public String toString(InputStream input, String encoding) throws IOException { return (null == encoding) ? toString(new InputStreamReader(input, RemotingHelper.DEFAULT_CHARSET)) : toString(new InputStreamReader( input, encoding)); }  }
IOTinyUtils { static public String toString(InputStream input, String encoding) throws IOException { return (null == encoding) ? toString(new InputStreamReader(input, RemotingHelper.DEFAULT_CHARSET)) : toString(new InputStreamReader( input, encoding)); }  static String toString(InputStream input, String encoding); static String toString(Reader reader); static long copy(Reader input, Writer output); static List<String> readLines(Reader input); static void copyFile(String source, String target); static void delete(File fileOrDir); static void cleanDirectory(File directory); static void writeStringToFile(File file, String data, String encoding); }
IOTinyUtils { static public String toString(InputStream input, String encoding) throws IOException { return (null == encoding) ? toString(new InputStreamReader(input, RemotingHelper.DEFAULT_CHARSET)) : toString(new InputStreamReader( input, encoding)); }  static String toString(InputStream input, String encoding); static String toString(Reader reader); static long copy(Reader input, Writer output); static List<String> readLines(Reader input); static void copyFile(String source, String target); static void delete(File fileOrDir); static void cleanDirectory(File directory); static void writeStringToFile(File file, String data, String encoding);  }