[英]What does 'result' in ExecutorService.submit(Runnable task, T result) do?
[英]use ExecutorService.submit result get Garbled
我使用jPowerShell在Java中執行powershell,但是我在executeCommand()
時出現了亂碼
這是我的代碼:
PowerShellResponse response = powerShell.executeCommand(getAll);
//Print results
System.out.println("result :" + response.getCommandOutput());
在executeCommand()
使用:
Future<String> result = threadpool.submit(commandProcessor);
commandOutput = result.get();
我不知道如何對結果進行編碼。
也許這會有所幫助?
Future<String> result = threadpool.submit(commandProcessor);
while (!result.isDone()) {}
String commandOutput = result.get();
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.