All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.gs4tr.gcc.restclient.util.StringUtils Maven / Gradle / Ivy

Go to download

GlobalLink Connect Cloud java is a library to connect your system to GlobalLink Connect Cloud REST API.

There is a newer version: 3.1.3
Show newest version
package org.gs4tr.gcc.restclient.util;

import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.Reader;

public class StringUtils {

    public static String toString(InputStream inputStream) throws IOException{
	final int bufferSize = 1024;
	final char[] buffer = new char[bufferSize];
	final StringBuilder out = new StringBuilder();
	Reader in = new InputStreamReader(inputStream, "UTF-8");
	for (; ; ) {
	    int rsz = in.read(buffer, 0, buffer.length);
	    if (rsz < 0)
	        break;
	    out.append(buffer, 0, rsz);
	}
	return out.toString();
    }

    public static Boolean isNullOrEmpty(String value){
	return value == null || value.trim().length()<=0;
    }
    
    public static Boolean IsNullOrWhiteSpace(String value){
	return isNullOrEmpty(value);
    }
    
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy