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

13
LINES

< > BotCompany Repo | #1008748 // copyStreamToDevNull

JavaX fragment (include)

static long copyStreamToDevNull(InputStream in) ctex {
  try {
    byte[] buf = new byte[65536];
    long total = 0;
    while (true) {
      int n = in.read(buf);
      total += n;
      if (n <= 0) return total;
    }
  } finally {
    in.close();
  }
}

Author comment

Began life as a copy of #1000844

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: #1008748
Snippet name: copyStreamToDevNull
Eternal ID of this version: #1008748/2
Text MD5: 29b533e4e80fce4fc4e3c46f88aadfa0
Author: stefan
Category: javax / i.o.
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2017-05-31 13:56:49
Source code size: 267 bytes / 13 lines
Pitched / IR pitched: No / No
Views / Downloads: 426 / 470
Version history: 1 change(s)
Referenced in: [show references]