Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

11
LINES

< > BotCompany Repo | #1027264 // drainErrorStreamToConsole

JavaX fragment (include) [tags: use-pretranspiled]

Libraryless. Click here for Pure Java version (2386L/15K).

1  
svoid drainErrorStreamToConsole(Process process, IPred<S> printIf, IF0<AutoCloseable> enter) {
2  
  thread "Drain error stream" {
3  
    temp enter!;
4  
    DataInputStream err = new(process.getErrorStream());
5  
    S line;
6  
    while ping ((line = err.readLine()) != null) {
7  
      if (printIf == null || printIf.get(line))
8  
        print("ERR: " + line);
9  
    }
10  
  }
11  
}

download  show line numbers  debug dex  old transpilations   

Travelled to 7 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt, xrpafgyirdlv

No comments. add comment

Snippet ID: #1027264
Snippet name: drainErrorStreamToConsole
Eternal ID of this version: #1027264/5
Text MD5: 1a87f506a9c9879f9ee9abb3b8f59d28
Transpilation MD5: 903dddbbe1482acfb744f44c958de4cd
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2020-02-28 12:33:28
Source code size: 364 bytes / 11 lines
Pitched / IR pitched: No / No
Views / Downloads: 190 / 275
Version history: 4 change(s)
Referenced in: [show references]