Java Utililty Methods InputStream Read by Encoding

List of utility methods to do InputStream Read by Encoding

Description

The list of methods to do InputStream Read by Encoding are organized into topic(s).

Method

StringgetStreamContent(InputStream is, String encoding)
get Stream Content
if (is == null)
    return null;
StringBuilder sb = new StringBuilder();
try (InputStreamReader br = new InputStreamReader(is, encoding)) {
    int len;
    char[] buf = new char[16384];
    while ((len = br.read(buf)) != -1)
        sb.append(buf, 0, len);
...
StringgetStreamContents(InputStream stream, String charset)
get Stream Contents
StringBuffer contents = new StringBuffer();
char[] buf = new char[4096];
InputStreamReader reader = null;
try {
    if (charset == null) {
        reader = new InputStreamReader(stream);
    } else {
        reader = new InputStreamReader(stream, charset);
...