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.get();} else {done = true;IOUtils.close(in);result = null;}success = true;} finally {if (!success) {IOUtils.closeWhileHandlingException(in);}}return result;}

public BytesRef Next(){if (done){return null;}bool success = false;BytesRef result;try{string line;if ((line = outerInstance.@in.ReadLine()) != null){spare.CopyChars(line);result = spare;}else{done = true;IOUtils.Dispose(outerInstance.@in);result = null;}success = true;}finally{if (!success){IOUtils.DisposeWhileHandlingException(outerInstance.@in);}}return result;}
