私はプロセスストリームからデータを読み込んでいます。基本的には、私はRuntime.exec APIを使用してプロセスを実行しており、プロセス入力ストリームを取得しています。ストリームからの不完全なデータ
私は、その後のようなプロセスの出力を収集していますRuntime rt = Runtime.getRuntime();
process = rt.exec("C:/cygwin/home/grec.exe");
InputStream is = process.getInputStream();
- 私は、文字列の出力を印刷していますしかし、私は取得しています
BufferedReader in = new BufferedReader(is);
char[] ls = new char[s.available()];
ls.read(ls);
String output = new String(ls);
-
break [loc] Add a breakpoint at [file:]line or template
callflow [val] Enable call flow tracing
next Execute the over instruction, stepping over calls
over Execute the current instruction hierarchy
しかし、実際に出力は -
break [loc] Add a breakpoint at [file:]line or template
callflow [val] Enable call flow tracing
next Execute the over instruction, stepping over calls
over Execute the current instruction hierarchy
print <xpath> Print the value of an XPath expression
profile [val] Turn profiler on or off
reload Reload the script contents
run Restart the script
step Execute the next instruction, stepping into calls
verbose Turn on verbose (-v) output logging
where Show the backtrace of template calls
quit Quit debugger
つまり、出力の一部が切り捨てられますが、コードによって例外はスローされません。 BufferedReaderのサイズを増やし、配列のサイズを増やしてみました。この現象の原因を見つけるために、私は紛失しています。これの原因となる可能性のあるヒントや指針は高く評価されます。
あなたのコード例では、 'S'は何ですか?そしておそらく私は何か見落としましたが、どうでしょうか? 'OutputStream out = process.getOutputStream();バッファリングされたリーダーbuffereredOut =新しいBufferedReader(出力); ' – bpgergo
実際にはまったく同じことをやっています。そして、これは私がやっていることです。 – user496934
ここでは実際にsはInputStreamを表しています。つまり、 - InputStream = process.getInputStream(); – user496934