public final class Util
extends java.lang.Object
| Modifier and Type | Method and Description |
|---|---|
static void |
closeQuietly(java.io.Closeable closeable)
Close any Closeable quietly if any exception
is thrown simple ignore it
|
static java.lang.String |
getUrlWithQueryString(java.lang.String url,
RequestParams requestParams)
Util for GET request method, convert the given RequestParams
into a valid URL String query
|
static byte[] |
inputStreamToByteArray(java.io.InputStream source)
Convert the given InputStream into a byte array
this class is based o Apache IOUtils common so it can read
more than 2GB with 4MB buffers
|
static java.lang.String |
inputStreamToString(java.io.InputStream source)
Convert the given InputStream to a String
|
public static java.lang.String inputStreamToString(java.io.InputStream source)
throws java.io.IOException
source - the InputStream to convertjava.io.IOException - If the given InputStream is null or can't be accessedpublic static java.lang.String getUrlWithQueryString(java.lang.String url,
RequestParams requestParams)
url - the base URL to concat the queryrequestParams - the query parametersRequestMethod,
RequestParamspublic static byte[] inputStreamToByteArray(java.io.InputStream source)
throws java.io.IOException
source - the InputStream to consumejava.io.IOException - if the given InputStream can't be decodedpublic static void closeQuietly(java.io.Closeable closeable)
closeable - a class that implements Closeable to close