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

相关推荐
AIGS0018 分钟前
企业AI落地:从RAG到AgentRAG的技术跃迁
java·人工智能·人工智能ai大模型应用
Java小白笔记14 分钟前
MySQL中存储过程大表分批删除历史数据
android·mysql·adb
aidou131436 分钟前
Kotlin中沉浸式状态栏显示布局
android·kotlin·windowmanager·沉浸式状态栏·insetslistener·insetscompat·systembars
鹏易灵38 分钟前
C++——8.移动语义初探(移动构造、移动赋值)
开发语言·c++·php
2601_962341301 小时前
计算机毕业设计之jsp考研在线复习平台
java·大数据·开发语言·hadoop·python·考研·课程设计
凯瑟琳.奥古斯特1 小时前
力扣1008:前序重建BST
开发语言·c++·算法·leetcode·职场和发展
huangjiazhi_1 小时前
纯C++实现ini文件操作
java·后端·spring
zhixingheyi_tian1 小时前
JVM 之 GCLocker
java·jvm
2zcode1 小时前
项目文档:基于MATLAB图像处理的饮料瓶灌装液位检测系统设计与实现
开发语言·图像处理·matlab