File tree Expand file tree Collapse file tree 1 file changed +3
-16
lines changed
substratevm/src/com.oracle.svm.hosted/src/com/oracle/svm/hosted/c/util Expand file tree Collapse file tree 1 file changed +3
-16
lines changed Original file line number Diff line number Diff line change 35
35
import java .nio .file .Files ;
36
36
import java .nio .file .Path ;
37
37
import java .nio .file .Paths ;
38
- import java .util .ArrayList ;
39
38
import java .util .Arrays ;
40
39
import java .util .List ;
41
40
42
- import jdk .graal .compiler .debug .DebugContext ;
43
41
import org .graalvm .nativeimage .ImageSingletons ;
44
42
45
43
import com .oracle .svm .core .SubstrateOptions ;
46
44
import com .oracle .svm .core .SubstrateUtil ;
47
45
import com .oracle .svm .core .c .libc .TemporaryBuildDirectoryProvider ;
48
46
47
+ import jdk .graal .compiler .debug .DebugContext ;
48
+
49
49
public class FileUtils {
50
50
51
51
public static void drainInputStream (InputStream source , OutputStream sink ) {
@@ -64,20 +64,7 @@ public static void drainInputStream(InputStream source, OutputStream sink) {
64
64
}
65
65
66
66
public static List <String > readAllLines (InputStream source ) {
67
- try {
68
- BufferedReader reader = new BufferedReader (new InputStreamReader (source ));
69
- List <String > result = new ArrayList <>();
70
- while (true ) {
71
- String line = reader .readLine ();
72
- if (line == null ) {
73
- break ;
74
- }
75
- result .add (line );
76
- }
77
- return result ;
78
- } catch (IOException ex ) {
79
- throw shouldNotReachHere (ex );
80
- }
67
+ return new BufferedReader (new InputStreamReader (source )).lines ().toList ();
81
68
}
82
69
83
70
public static int executeCommand (String ... args ) throws IOException , InterruptedException {
You can’t perform that action at this time.
0 commit comments