Android 回显

//执行

private void playRunTime(String cmd) throws Exception {

Process p = Runtime.getRuntime().exec(cmd);

InputStream is = p.getInputStream();

BufferedReader reader = new BufferedReader(new InputStreamReader(is));

String line;

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

tv_result.append(line + "\n");

}

p.waitFor();

is.close();

reader.close();

p.destroy();

}

若cmd 执行后回显的字符太长,导致string 无法完整保存结果该如何处理

StringBuilder outputBuilder = new StringBuilder();

String line;

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

outputBuilder.append(line).append("\n");

}

git push mega HEAD:refs/for/

repo forall -c 'git reset --hard'

repo forall -c 'git clean -f -d'

repo sync -d -c --no-tags

相关推荐
晓13131 分钟前
第七章 【C语言篇:文件】 文件全面解析
linux·c语言·开发语言
愚者游世1 分钟前
Delegating Constructor(委托构造函数)各版本异同
开发语言·c++·程序人生·面试·改行学it
一 乐2 分钟前
校园二手交易|基于springboot + vue校园二手交易系统(源码+数据库+文档)
java·数据库·vue.js·spring boot·后端
KIKIiiiiiiii3 分钟前
微信个人号API二次开发中的解决经验
java·人工智能·python·微信
梵刹古音3 分钟前
【C语言】 指针基础与定义
c语言·开发语言·算法
80530单词突击赢4 分钟前
SpringBoot整合SpringMVC全解析
java·spring boot·后端
Ekehlaft7 分钟前
这款国产 AI,让 Python 小白也能玩转编程
开发语言·人工智能·python·ai·aipy
rit84324999 分钟前
MATLAB中Teager能量算子提取与解调信号的实现
开发语言·matlab
开源技术12 分钟前
Python GeoPandas基础知识:地图、投影和空间连接
开发语言·ide·python
vx1_Biye_Design14 分钟前
基于Spring Boot+Vue的学生管理系统设计与实现-计算机毕业设计源码46223
java·vue.js·spring boot·spring·eclipse·tomcat·maven