mirror of
https://github.com/arduino/Arduino.git
synced 2025-02-10 04:54:21 +01:00
22 lines
467 B
Java
22 lines
467 B
Java
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();
|
|
}
|
|
}
|
|
}
|