text: public virtual BytesRef Next(){if (scratch == null){return null;}bool success = false;try{byte[] next = reader.Read();if (next != null){scratch.Bytes = next;scratch.Length = next.Length;scratch.Offset = 0;}else{IOUtils.Dispose(reader);scratch = null;}success = true;return scratch;}finally{if (!success){IOUtils.DisposeWhileHandlingException(reader);}}}