简体   繁体   English

将输入流暂停到Java,类似于Unix中的Ctrl-Z

[英]pause input stream to java similar to Ctrl-Z in Unix

EDIT: The class I am looking to write is in turn going to be called by a framework. 编辑:我要编写的类将依次由框架调用。 The framework loads my class and asks it to fetch x number of rows from the 'source' - at at time - so it can then pass those x rows down and do stuff with it. 框架加载了我的类,并要求它从“源”中获取x的行数-一次-因此它可以向下传递这些x的行并对其进行处理。 The 'source' is a command and I don't see any provisions in the command documentation of batching -so I was thinking i could get the class to basically pause/suspend the command every x rows. “源”是一个命令,我在批处理的命令文档中看不到任何规定-因此我想我可以使该类基本上每x行暂停/暂停该命令。 Thoughts ??? 想法???

If I am trying to read the output of a command into a Java program, can I 'pause/suspend' it like I can from the Linux/Unix command line itself? 如果我试图将命令的输出读入Java程序,是否可以像从Linux / Unix命令行本身一样“暂停/暂停”它? For eg if I am running "command-x" and then hit Ctrl-Z, it essentially stops the command, which I can continue later. 例如,如果我正在运行“ command-x”,然后按Ctrl-Z,它实际上会停止该命令,以后可以继续执行。

Is that possible for me to do when I am reading the output of the program in Java? 当我用Java读取程序的输出时,可以这样做吗? Or is that something the command has to support? 还是命令必须支持的内容?

Thanks in advance! 提前致谢!

You should use breakpoints. 您应该使用断点。 Program execution will stop at the breakpoint and you can have a look at the current state of variables, or step through the program line by line. 程序执行将在断点处停止,您可以查看变量的当前状态,或逐行浏览程序。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM