Java InputStream to String inputStreamToString(InputStream in)

Here you can find the source of inputStreamToString(InputStream in)

Description

input Stream To String

License

Open Source License

Declaration

static String inputStreamToString(InputStream in) 

Method Source Code


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

public class Main {
    static String inputStreamToString(InputStream in) {
        Scanner scanner = new Scanner(in).useDelimiter("\\A");
        return scanner.next();
    }/*  ww  w  .j  a  va2 s .c  o  m*/
}

Related

  1. inputStreamToString(final InputStream inputStream, final String... optionalCharsetName)
  2. inputStreamToString(final InputStream is, final int bufferSize)
  3. inputStreamToString(final InputStream stream)
  4. inputStreamToString(final InputStream stream, final String charset)
  5. inputStreamToString(InputStream in)
  6. InputStreamTOString(InputStream in)
  7. inputStreamToString(InputStream in)
  8. inputStreamToString(InputStream in)
  9. inputStreamToString(InputStream in)