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

5
LINES

< > BotCompany Repo | #1021217 // linesFromFile_bounded - end at certain byte index

JavaX fragment (include)

static CloseableIterableIterator<S> linesFromFile_bounded(File f, long max) ctex {
  if (!f.exists()) ret emptyCloseableIterableIterator();
  InputStream in = ewic(f.getName(), ".gz") ? newGZIPInputStream(f) : newFileInputStream(f);
  ret linesFromReader(utf8bufferedReader(BoundedInputStream(max, in)));
}

Author comment

Began life as a copy of #1011460

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1021217
Snippet name: linesFromFile_bounded - end at certain byte index
Eternal ID of this version: #1021217/3
Text MD5: dc803f3a50de4614f7ef0e36d4ffe4cd
Author: stefan
Category: javax / i.o.
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2019-02-03 15:11:23
Source code size: 310 bytes / 5 lines
Pitched / IR pitched: No / No
Views / Downloads: 309 / 327
Version history: 2 change(s)
Referenced in: #1006654 - Standard functions list 2 (LIVE, continuation of #761)