Returns the reader index for document <code>n</code>.

@param n document number.
@return the reader index.
354051
protected final int readerIndex(int n)
   {
      int lo = 0;
      int hi = readers.size() - 1;

      while (hi >= lo)
      {
         int mid = (lo + hi) >> 1;
         int midValue = starts[mid];
         if (n < midValue)
         {
            hi = mid - 1;
         }
         else if (n > midValue)
         {
            lo = mid + 1;
         }
         else
         {
            while (mid + 1 < readers.size() && starts[mid + 1] == midValue)
            {
               mid++;
            }
            return mid;
         }
      }
      return hi;
   }
1071596
def read(self, n=None):
        
        response = b""
        while len(self.streams) > 0 and (n is None or n > 0):
            txt = self.streams[0].read(n)
            response += txt
            if n is not None:
                n -= len(txt)
            if n is None or n > 0:
                del self.streams[0]
        return response
999194
int numDocs() throws IOException
   {
      if (indexNames.size() == 0)
      {
         return volatileIndex.getNumDocuments();
      }
      else
      {
         CachingMultiIndexReader reader = getIndexReader();
         try
         {
            return reader.numDocs();
         }
         finally
         {
            reader.release();
         }
      }
   }
501412
@Override
    public long skip( final long n ) throws IOException {
        assert n > 0;

        long charsLeft = n;
        // note the read side effect
        while ( charsLeft > 0 && read() != -1 ) {
            charsLeft--;
        }
        return n - charsLeft;
    }
686453
public static INDArrayIndex[] nTimes(INDArrayIndex copy, int n) {
        INDArrayIndex[] ret = new INDArrayIndex[n];
        for (int i = 0; i < n; i++) {
            ret[i] = copy;
        }

        return ret;
    }
856151
private int getIndex(PdfName key) {
		for (int i = 0; i < VIEWER_PREFERENCES.length; i++) {
			if (VIEWER_PREFERENCES[i].equals(key))
				return i;
		}
		return -1;
	}
268612
@Nonnegative
  public static long getSmallFactorial (@Nonnegative final int n)
  {
    ValueEnforcer.isBetweenInclusive (n, "n", PREDEFINED_MIN_INDEX, PREDEFINED_MAX_INDEX);
    return PREDEFINED_FACTORIALS_LONG[n];
  }
1373250
def read(self, n):
        """"""
        r = self.buf[self.offset:self.offset + n]
        if isinstance(r, array):
            r = r.tostring()
        self.offset += n
        return r
846762
def read(self, n):
        
        self._check_underflow(n)
        rval = self._input[self._pos:self._pos + n]
        self._pos += n
        return rval
1065844
def read(self, n):
        
        pos = self._read_pos
        self._read_pos = min(len(self.raw), pos + n)
        return self.raw[pos:self._read_pos]
1151171
public String next( int n ) {
      int i = this.myIndex;
      int j = i + n;
      if( j >= this.mySource.length() ){
         throw syntaxError( "Substring bounds error" );
      }
      this.myIndex += n;
      return this.mySource.substring( i, j );
   }
1252402
public int read() throws IOException {
        synchronized (lock) {
            ensureOpen();
            for (;;) {
                if (nextChar >= nChars) {
                    fill();
                    if (nextChar >= nChars)
                        return -1;
                }
                if (skipLF) {
                    skipLF = false;
                    if (cb[nextChar] == '\n') {
                        nextChar++;
                        continue;
                    }
                }
                return cb[nextChar++];
            }
        }
    }
1101846
public int getIndex(Object key) {
    int[] nums = (int[]) cset.get(key);
    if (nums == null) {
      return -1;
    }
    else {
      return nums[1];
    }
  }
289274
def read_or_raise(reader, n=-1):
    
    data = yield from reader.read(n)
    if not data:
        raise NoDataException("No more data")
    return data
853532
public function read($n) {
    if ($n < 1) {
      return "";
    }

    $string = fread($this->f, $n);
    $chunks = str_split($string, 2);
    $chunks = array_map("strrev", $chunks);

    return implode("", $chunks);
  }
1344084
public List<T> first(final int n) {
        N.checkArgument(n >= 0, "'n' can't be negative: " + n);

        if (N.isNullOrEmpty(coll) || n == 0) {
            return new ArrayList<>();
        } else if (coll.size() <= n) {
            return new ArrayList<>(coll);
        } else if (coll instanceof List) {
            return new ArrayList<>(((List<T>) coll).subList(0, n));
        } else {
            final List<T> result = new ArrayList<>(N.min(n, coll.size()));
            int cnt = 0;

            for (T e : coll) {
                result.add(e);

                if (++cnt == n) {
                    break;
                }
            }

            return result;
        }
    }
1279841
public NodeAVL getNode(int index) {

        NodeAVL n = nPrimaryNode;

        while (index-- > 0) {
            n = n.nNext;
        }

        return n;
    }