/// <summary>Read the matching key from a set into <code>key</code>.</summary> /// <remarks> /// Read the matching key from a set into <code>key</code>. /// Returns <code>key</code>, or null if no match exists. /// </remarks> /// <exception cref="System.IO.IOException"/> public virtual IWritableComparable Get(IWritableComparable key) { if (Seek(key)) { Next(key); return(key); } else { return(null); } }
/// <exception cref="System.IO.IOException"/> public TextRecordInputStream(Display _enclosing, FileStatus f) { this._enclosing = _enclosing; Path fpath = f.GetPath(); Configuration lconf = this._enclosing.GetConf(); this.r = new SequenceFile.Reader(lconf, SequenceFile.Reader.File(fpath)); this.key = ReflectionUtils.NewInstance(this.r.GetKeyClass().AsSubclass <IWritableComparable <> >(), lconf); this.val = ReflectionUtils.NewInstance(this.r.GetValueClass().AsSubclass <IWritable >(), lconf); this.inbuf = new DataInputBuffer(); this.outbuf = new DataOutputBuffer(); }