static int loadTextFilePart_iterator_chunkSize = 65536; // TODO: close on failure static Iterable loadTextFilePart_iterator(File file, long start, long end) ctex { if (end-start <= loadTextFilePart_iterator_chunkSize) ret ll(loadTextFilePart(file, start, end)); final FileInputStream in = newFileInputStream(file); in.skip(start); final byte[] buf = new byte[loadTextFilePart_iterator_chunkSize]; final new UTF8Processor p; ret iteratorFF(func -> O { S s = readChunkThroughUTF8Processor(p, in, buf); //print("Chunk read: " + l(s)); if (nempty(s)) ret s; in.close(); ret endMarker(); }); }