class InputStreamConverter {

    public String getStringFromStream(final InputStream inputStream) throws ApplicationException {
        String result = "";
        if (inputStream != null) {
            try {
                int extendedReadLimit = inputStream.available() + BUFFER_SIZE;
                inputStream.mark(extendedReadLimit);
                result = IOUtils.toString(inputStream);
                inputStream.reset();
            } catch (IOException e) {
                throw new ApplicationException("Could not transform request input stream into string!", e);
            }
        }
        return result;
    }

}