Android InputStream to String Convert convertStreamToString(java.io.InputStream is)

Here you can find the source of convertStreamToString(java.io.InputStream is)

Description

convert Stream To String

Declaration

static String convertStreamToString(java.io.InputStream is) 

Method Source Code

//package com.java2s;
import java.util.Scanner;

public class Main {
    static String convertStreamToString(java.io.InputStream is) {
        try {/* w  w  w .j a  v  a 2  s .c  o  m*/
            return new Scanner(is).useDelimiter("\\A").next();
        } catch (java.util.NoSuchElementException e) {
            return "";
        }
    }
}

Related

  1. convertStreamToString(InputStream is)
  2. convertStreamToString(InputStream is)
  3. convertStreamToString(InputStream is)
  4. convertStreamToString(InputStream is)
  5. convertStreamToString(InputStream is)
  6. convertStreamToString(java.io.InputStream is)
  7. streamToString(InputStream is)
  8. stringFromInputStream(InputStream is)
  9. getStringFromInputStream(InputStream is)