Code example for StreamSource

Methods: getInputStreamgetReader

     * @return a {@link String} that contains the content of the provided {@link Reader}. 
     * @throws IOException 
     *             in case something bad happens. 
    public static String toString(final StreamSource src, final String ecoding) throws IOException {
        InputStream inputStream = src.getInputStream();
        if (inputStream != null) {
            return, ecoding);
        } else { 
            final Reader r = src.getReader();
     * Convert the input from the provided {@link Reader} into a {@link String}. 
     * @param inputStream 
Contextual code suggestions in your IDE  Get Codota for Java