|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.axiom.attachments.utils.ByteSearch
public class ByteSearch
ByteSearch Various byte array searching utilities. This includes a "skip search", which is a an optimized search for finding a byte pattern in a large byte array.
| Constructor Summary | |
|---|---|
ByteSearch()
|
|
| Method Summary | |
|---|---|
static short[] |
getSkipArray(byte[] pattern,
boolean direction)
skipArray Builds a skip array for this pattern and direction. |
static boolean |
isEqual(byte[] pattern,
byte[] buffer,
int start,
int end)
isEqual |
static int |
search(byte[] search,
byte[] bytes,
int start,
int end,
boolean direction)
search Look for the search bytes in the bytes array using a straight search. |
static int |
skipSearch(byte[] pattern,
boolean direction,
byte[] buffer,
int start,
int end,
short[] skip)
Search a byte sequence for a given pattern. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ByteSearch()
| Method Detail |
|---|
public static int skipSearch(byte[] pattern,
boolean direction,
byte[] buffer,
int start,
int end,
short[] skip)
pattern - byte[]direction - true if forward, false if backwardbuffer - byte[] to searchstart - index to start searchend - index to end search (end index is not within the search)skip - short[256] A skipArray generated from a call to
generateSkipArray.
public static short[] getSkipArray(byte[] pattern,
boolean direction)
pattern - direction -
public static boolean isEqual(byte[] pattern,
byte[] buffer,
int start,
int end)
pattern - buffer - start - indexend - index
public static int search(byte[] search,
byte[] bytes,
int start,
int end,
boolean direction)
search - byte[]bytes - byte[] to searchstart - starting indexend - end index (exclusivedirection - boolean (true indicates forward search, false is backwards search
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||