public class SearchPattern extends Object
| Modifier and Type | Method and Description |
|---|---|
static SearchPattern |
compile(byte[] pattern)
Produces a SearchPattern instance which can be used
to find matches of the pattern in data
|
static SearchPattern |
compile(String pattern)
Produces a SearchPattern instance which can be used
to find matches of the pattern in data
|
int |
endsWith(byte[] data,
int offset,
int length)
Search for a partial match of the pattern at the end of the data.
|
int |
getLength() |
int |
match(byte[] data,
int offset,
int length)
Search for a complete match of the pattern within the data
|
int |
startsWith(byte[] data,
int offset,
int length,
int matched)
Search for a possibly partial match of the pattern at the start of the data.
|
public static SearchPattern compile(byte[] pattern)
pattern - byte array containing the patternpublic static SearchPattern compile(String pattern)
pattern - string containing the patternpublic int match(byte[] data,
int offset,
int length)
data - The data in which to search for. The data may be arbitrary binary data,
but the pattern will always be StandardCharsets.US_ASCII encoded.offset - The offset within the data to start the searchlength - The length of the data to searchpublic int endsWith(byte[] data,
int offset,
int length)
data - The data in which to search for. The data may be arbitrary binary data,
but the pattern will always be StandardCharsets.US_ASCII encoded.offset - The offset within the data to start the searchlength - The length of the data to searchpublic int startsWith(byte[] data,
int offset,
int length,
int matched)
data - The data in which to search for. The data may be arbitrary binary data,
but the pattern will always be StandardCharsets.US_ASCII encoded.offset - The offset within the data to start the searchlength - The length of the data to searchmatched - The length of the partial pattern already matchedpublic int getLength()
Copyright © 2010 - 2020 Adobe. All Rights Reserved