集册 Java实例教程 从读者那里读

从读者那里读

欢马劈雪     最近更新时间:2020-01-02 10:19:05

428
从读者那里读


//package com.nowjava;

import java.io.BufferedReader;

/**
时 代 J     a    v  a - nowjava.com 提供 
**/

import java.io.IOException;


import java.io.Reader;


public class Main {

    /**

     *

     * @param reader

     * @return

     * @throws IOException

     */

    public static String readStream(Reader reader) throws IOException {

        StringBuilder result = new StringBuilder();

        BufferedReader in = new BufferedReader(reader);

        String line;

        while ((line = in.readLine()) != null) {

            result.append(line);

            result.append(
展开阅读全文