Java InputStream Read All readAllInString(InputStream in)

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

Description

read All In String

License

Open Source License

Declaration

public static String readAllInString(InputStream in) throws IOException 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import java.io.IOException;
import java.io.InputStream;

public class Main {
    public static String readAllInString(InputStream in) throws IOException {
        return new String(readAll(in));
    }//  w  ww  .ja v  a2 s .  co m

    public static byte[] readAll(InputStream in) throws IOException {
        byte[] result = new byte[in.available()];
        in.read(result);
        return result;
    }
}

Related

  1. readAll(InputStream stream)
  2. readAll(InputStream stream)
  3. readAllBuffer(InputStream stream, byte[] buffer)
  4. readAllFrom(java.io.InputStream is)
  5. readAllFromStream(InputStream is)