码迷,mamicode.com
首页 > 其他好文 > 详细

接收一行带空格的字符串

时间:2015-05-02 18:09:20      阅读:155      评论:0      收藏:0      [点我收藏+]

标签:

  public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String str;
        while ((str = br.readLine()) != null)

        {
            List<String> resultList = executeLinuxCommand(str);
            for (String result : resultList) {
                LOGGER.info(result);
            }
        }
    }

 

键盘输入是字节流,转化为字符流,再调用装饰的readLine方法

接收一行带空格的字符串

标签:

原文地址:http://www.cnblogs.com/balfish/p/4472225.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!