@Authors(value="Nikolche Mihajlovski")
@Since(value="2.0.0")
public class BytesUtil
extends org.rapidoid.RapidoidThing
| Modifier and Type | Field and Description |
|---|---|
static byte[] |
CHARS_SWITCH_CASE |
| Constructor and Description |
|---|
BytesUtil() |
| Modifier and Type | Method and Description |
|---|---|
static boolean |
containsAt(Bytes bytes,
BufRange target,
int offset,
byte[] match,
boolean caseSensitive) |
static int |
find(Bytes bytes,
int start,
int limit,
byte[] match,
boolean caseSensitive) |
static int |
find(Bytes bytes,
int start,
int limit,
byte[] match,
int offset,
int length,
boolean caseSensitive) |
static int |
find(Bytes bytes,
int start,
int limit,
byte match,
boolean caseSensitive) |
static Bytes |
from(byte[] bytes) |
static Bytes |
from(String s) |
static String |
get(Bytes bytes,
BufRange range) |
static BufRange |
getByPrefix(Bytes bytes,
BufRanges ranges,
byte[] prefix,
boolean caseSensitive) |
static byte[] |
getBytes(Bytes bytes,
BufRange range) |
static int |
getIntPrefixOf(Bytes bytes,
int position,
int limit) |
static boolean |
isValidURI(Bytes bytes,
BufRange uri) |
static boolean |
match(Bytes bytes,
int start,
byte[] match,
boolean caseSensitive) |
static boolean |
match(Bytes bytes,
int start,
byte[] match,
int offset,
int length,
boolean caseSensitive) |
static boolean |
matches(Bytes bytes,
BufRange target,
byte[] match,
boolean caseSensitive) |
static boolean |
matchNoCase(Bytes bytes,
int start,
byte[] match,
int offset,
int length) |
static boolean |
matchSensitive(Bytes bytes,
int start,
byte[] match,
int offset,
int length) |
static int |
parseLine(Bytes bytes,
BufRange line,
int start,
int limit) |
static int |
parseLines(Bytes bytes,
BufRanges lines,
int start,
int limit) |
static int |
parseLines(Bytes bytes,
BufRanges lines,
org.rapidoid.wrap.IntWrap res,
int start,
int limit,
byte end1,
byte end2) |
static int |
scan(Bytes bytes,
int from,
int to,
byte value) |
static int |
scanLnAndMatchPrefix(Bytes bytes,
BufRange result,
int fromPos,
int toPos,
int searchPrefix)
Scans the buffer until a line separator (CRLF or LF) is found, and matches the 4-byte prefix of the scanned
selection against the specified search prefix.
|
static int |
scanNoCase(Bytes bytes,
int from,
int to,
byte value) |
static int |
scanUntilAndMatchPrefix(Bytes bytes,
BufRange result,
byte separator,
int fromPos,
int toPos,
int searchPrefix)
Scans the buffer until the specified separator is found, and matches the 4-byte prefix of the scanned selection
against the specified search prefix.
|
static boolean |
split(Bytes bytes,
BufRange target,
byte sep,
BufRange before,
BufRange after,
boolean trimParts) |
static boolean |
startsWith(Bytes bytes,
BufRange target,
byte[] match,
boolean caseSensitive) |
static void |
trim(Bytes bytes,
BufRange target) |
public static Bytes from(byte[] bytes)
public static int parseLines(Bytes bytes, BufRanges lines, org.rapidoid.wrap.IntWrap res, int start, int limit, byte end1, byte end2)
public static BufRange getByPrefix(Bytes bytes, BufRanges ranges, byte[] prefix, boolean caseSensitive)
public static int scan(Bytes bytes, int from, int to, byte value)
public static int scanNoCase(Bytes bytes, int from, int to, byte value)
public static boolean match(Bytes bytes, int start, byte[] match, int offset, int length, boolean caseSensitive)
public static boolean matchNoCase(Bytes bytes, int start, byte[] match, int offset, int length)
public static boolean matchSensitive(Bytes bytes, int start, byte[] match, int offset, int length)
public static boolean match(Bytes bytes, int start, byte[] match, boolean caseSensitive)
public static int find(Bytes bytes, int start, int limit, byte match, boolean caseSensitive)
public static int find(Bytes bytes, int start, int limit, byte[] match, boolean caseSensitive)
public static int find(Bytes bytes, int start, int limit, byte[] match, int offset, int length, boolean caseSensitive)
public static boolean matches(Bytes bytes, BufRange target, byte[] match, boolean caseSensitive)
public static boolean startsWith(Bytes bytes, BufRange target, byte[] match, boolean caseSensitive)
public static boolean containsAt(Bytes bytes, BufRange target, int offset, byte[] match, boolean caseSensitive)
public static boolean split(Bytes bytes, BufRange target, byte sep, BufRange before, BufRange after, boolean trimParts)
public static int scanUntilAndMatchPrefix(Bytes bytes, BufRange result, byte separator, int fromPos, int toPos, int searchPrefix)
-1 if the limit is
reached and separator not found. If the prefix is matched, the negative of the position is returned, to mark the
prefix match. Duplicated code for performance reasons.public static int scanLnAndMatchPrefix(Bytes bytes, BufRange result, int fromPos, int toPos, int searchPrefix)
-1 if the
limit is reached and separator not found. If the prefix is matched, the negative of the position is returned, to
mark the prefix match. Duplicated code for performance reasons.public static int getIntPrefixOf(Bytes bytes, int position, int limit)
Copyright © 2014–2017 Nikolche Mihajlovski and contributors. All rights reserved.