DirCache.findEntry(byte[], in) made public

Change-Id: Ice64e3b0e5d67a39690aa24e41c954b8ce312d49
Signed-off-by: Marc Strapetz <marc.strapetz@syntevo.com>‌
This commit is contained in:
Marc Strapetz 2013-05-27 10:32:47 +02:00
parent 8e0e78858c
commit 21498aec83
1 changed files with 20 additions and 8 deletions

View File

@ -731,13 +731,7 @@ public void unlock() {
/**
* Locate the position a path's entry is at in the index.
* <p>
* If there is at least one entry in the index for this path the position of
* the lowest stage is returned. Subsequent stages can be identified by
* testing consecutive entries until the path differs.
* <p>
* If no path matches the entry -(position+1) is returned, where position is
* the location it would have gone within the index.
* For details refer to #findEntry(byte[], int).
*
* @param path
* the path to search for.
@ -750,7 +744,25 @@ public int findEntry(final String path) {
return findEntry(p, p.length);
}
int findEntry(final byte[] p, final int pLen) {
/**
* Locate the position a path's entry is at in the index.
* <p>
* If there is at least one entry in the index for this path the position of
* the lowest stage is returned. Subsequent stages can be identified by
* testing consecutive entries until the path differs.
* <p>
* If no path matches the entry -(position+1) is returned, where position is
* the location it would have gone within the index.
*
* @param p
* the byte array starting with the path to search for.
* @param pLen
* the length of the path in bytes
* @return if >= 0 then the return value is the position of the entry in the
* index; pass to {@link #getEntry(int)} to obtain the entry
* information. If < 0 the entry does not exist in the index.
*/
public int findEntry(final byte[] p, final int pLen) {
int low = 0;
int high = entryCnt;
while (low < high) {