Java Reader Read All readAll(Reader rd)

Here you can find the source of readAll(Reader rd)

Description

read All

License

Open Source License

Declaration

private static String readAll(Reader rd) throws IOException 

Method Source Code


//package com.java2s;

import java.io.*;

public class Main {
    private static String readAll(Reader rd) throws IOException {
        StringBuilder sb = new StringBuilder();
        int cp;/*w ww .  jav  a 2s . com*/
        while ((cp = rd.read()) != -1) {
            sb.append((char) cp);
        }
        return sb.toString();
    }
}

Related

  1. readAll(final Reader rd)
  2. readAll(Reader in)
  3. readAll(Reader in)
  4. readAll(Reader rd)
  5. readAll(Reader rd)
  6. readAll(Reader rd)
  7. readAll(Reader reader)