首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何使用com.strobel.decompiler.PlainTextOutput在控制台中打印

如何使用com.strobel.decompiler.PlainTextOutput在控制台中打印
EN

Stack Overflow用户
提问于 2014-03-10 18:57:41
回答 1查看 125关注 0票数 0

我在我的应用程序中使用Proycon库,PlainTextOutput是Proycon库中的一个类,

在谷歌搜索过程中,我发现了代码块,给定below.what这意味着,我可以使用此代码打印到控制台吗?

代码语言:javascript
复制
com.strobel.decompiler.Decompiler.decompile(
         "D:\\BuildConfig.class",new com.strobel.decompiler.PlainTextOutput(new java.io.OutputStreamWriter(System.out)));
EN

回答 1

Stack Overflow用户

发布于 2014-03-11 01:29:52

这似乎是实现过程中的疏忽;它不会为您刷新Writer。试试这个:

代码语言:javascript
复制
final PrintWriter writer = new PrintWriter(System.out);

try {
    com.strobel.decompiler.Decompiler.decompile(
        "D:\\BuildConfig.class",
        new com.strobel.decompiler.PlainTextOutput(writer)
    );
}
finally {
    writer.flush();
}

我将在下一个Procyon版本中研究修复这个问题。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/22298263

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档