protected String getContent2(InputStream inputStream, String charset) throws IOException {
        int length = 0;
        byte[] buffer = new byte[8192];
        ByteArrayOutputStream bos = new ByteArrayOutputStream();

        try {
            while((length = inputStream.read(buffer, 0, 8192)) >0) {
                bos.write(buffer, 0, length);
            }
            return new String(bos.toByteArray(), charset);
        }
        finally {
            try {
                inputStream.close();
            }
            catch(Exception e) {
            }
        }
    }
protected String getContent2 ( InputStream inputStream , String charset ) throws IOException { int length = 0 ; byte [ ] buffer = new byte [ 8192 ] ; ByteArrayOutputStream bos = new ByteArrayOutputStream ( ) ; try { while ( ( length = inputStream . read ( buffer , 0 , 8192 ) ) > 0 ) { bos . write ( buffer , 0 , length ) ; } return new String ( bos . toByteArray ( ) , charset ) ; } finally { try { inputStream . close ( ) ; } catch ( Exception e ) { } } }
@param inputStream
@param charset
@return String
@throws IOException