Java で StringReader を使用して、文字列の長さが分からない文字列の最後まで読み取るにはどうすればよいですか。
これは私がこれまでに得た距離です:
public static boolean portForward(Device dev, int localPort, int remotePort)
{
boolean success = false;
AdbCommand adbCmd = Adb.formAdbCommand(dev, "forward", "tcp:" + localPort, "tcp:" + remotePort);
StringReader reader = new StringReader(executeAdbCommand(adbCmd));
try
{
if (/*This is what's missing :/ */)
{
success = true;
}
} catch (Exception ex) {
JOptionPane.showMessageDialog(null, "There was an error while retrieving the list of devices.\n" + ex + "\nPlease report this error to the developer/s.", "Error Retrieving Devices", JOptionPane.ERROR_MESSAGE);
} finally {
reader.close();
}
return success;
}