Here you can find the source of loadChars(Reader in)
Parameter | Description |
---|---|
in | the character source |
public static String loadChars(Reader in) throws IOException
//package com.java2s; import java.io.IOException; import java.io.Reader; public class Main { /**/*from www .ja v a 2s .com*/ * Load the characters contained in specified source. * * @param in the character source * @return the contents of the character source * @exception IOException if there is an I/O problem */ public static String loadChars(Reader in) throws IOException { StringBuilder buffer = new StringBuilder(); char[] chars = new char[65536]; int count; while ((count = in.read(chars, 0, chars.length)) != -1) { if (count > 0) { buffer.append(chars, 0, count); } } return buffer.toString(); } }