mirror of
https://github.com/esp8266/Arduino.git
synced 2025-07-30 16:24:09 +03:00
working on #223: Auto-detection of serial ports. Mac version ready even if a bit slow
This commit is contained in:
21
app/test/processing/app/TestHelper.java
Normal file
21
app/test/processing/app/TestHelper.java
Normal file
@ -0,0 +1,21 @@
|
||||
package processing.app;
|
||||
|
||||
import java.io.*;
|
||||
|
||||
public class TestHelper {
|
||||
|
||||
public static String inputStreamToString(InputStream is) throws IOException {
|
||||
StringWriter sw = new StringWriter();
|
||||
|
||||
BufferedReader reader = new BufferedReader(new InputStreamReader(is));
|
||||
String line;
|
||||
try {
|
||||
while ((line = reader.readLine()) != null) {
|
||||
sw.append(line).append('\n');
|
||||
}
|
||||
return sw.toString();
|
||||
} finally {
|
||||
is.close();
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user