@Override public BytesRef next() throws IOException { if (done) { return null; } boolean success = false; BytesRef result; try { String line; if ((line = in.readLine()) != null) { spare.copyChars(line); result = spare; } else { done = true; IOUtils.close(in); result = null; } success = true; } finally { if (!success) { IOUtils.closeWhileHandlingException(in); } } return result; }
protected IndexBytesValues(String index) { super(false); scratch = new BytesRef(); scratch.copyChars(index); }