1 | // read stream and print to system.out with line prefix |
2 | static void streamGobble(final InputStream is, final String type) {
|
3 | thread {
|
4 | InputStreamReader isr = new InputStreamReader(is); |
5 | BufferedReader br = new BufferedReader(isr); |
6 | String line = null; |
7 | while ((line = br.readLine()) != null) |
8 | System.out.println(type + "> " + line); |
9 | } |
10 | } |
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: | 848 / 807 |
| Referenced in: | [show references] |