text: public BytesRef next() throws IOException {boolean success = false;try {scratch = reader.next();if (scratch == null) {reader.close();}success = true;return scratch;} finally {if (!success) {IOUtils.closeWhileHandlingException(reader);}}}