File tree Expand file tree Collapse file tree 1 file changed +0
-27
lines changed
core/src/main/java/io/github/cowwoc/anchor4j/core/internal/client Expand file tree Collapse file tree 1 file changed +0
-27
lines changed Original file line number Diff line number Diff line change 11package io .github .cowwoc .anchor4j .core .internal .client ;
22
33import io .github .cowwoc .pouch .core .WrappedCheckedException ;
4- import org .slf4j .Logger ;
54
65import java .io .BufferedReader ;
76import java .io .File ;
@@ -43,32 +42,6 @@ public interface RunnableCommand
4342 void run () throws IOException , InterruptedException ;
4443 }
4544
46- /**
47- * Discards the remaining data from the given reader and closes it.
48- * <p>
49- * This is typically used to drain a process's output or error reade to avoid deadlocks when the process
50- * writes more data than the reader's buffer can hold.
51- *
52- * @param reader the reader
53- * @param log the logger used to record any exceptions that are thrown while reading from the reader
54- */
55- public static void discard (BufferedReader reader , Logger log )
56- {
57- try (reader )
58- {
59- while (true )
60- {
61- String line = reader .readLine ();
62- if (line == null )
63- break ;
64- }
65- }
66- catch (IOException | RuntimeException e )
67- {
68- log .error ("" , e );
69- }
70- }
71-
7245 /**
7346 * Consumes a stream's output.
7447 *
You can’t perform that action at this time.
0 commit comments