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

10
LINES

< > BotCompany Repo | #1001811 // streamGobble

JavaX fragment (include)

// read stream and print to system.out with line prefix
static void streamGobble(final InputStream is, final String type) {
  thread {
    InputStreamReader isr = new InputStreamReader(is);
    BufferedReader br = new BufferedReader(isr);
    String line = null;
    while ((line = br.readLine()) != null)
      System.out.println(type + "> " + line);
  }
}

download  show line numbers  debug dex  old transpilations   

Travelled to 13 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1001811
Snippet name: streamGobble
Eternal ID of this version: #1001811/1
Text MD5: 93b990b2197495394f16d95a9b109c7b
Author: stefan
Category:
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2015-11-17 22:14:16
Source code size: 366 bytes / 10 lines
Pitched / IR pitched: No / Yes
Views / Downloads: 610 / 562
Referenced in: #3000382 - Answer for ferdie (>> t = 1, f = 0)