public class BytesUtil extends Object implements org.rapidoid.util.Constants
| 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,
Range target,
long offset,
byte[] match,
boolean caseSensitive) |
static long |
find(Bytes bytes,
long start,
long limit,
byte[] match,
boolean caseSensitive) |
static long |
find(Bytes bytes,
long start,
long limit,
byte[] match,
int offset,
int length,
boolean caseSensitive) |
static long |
find(Bytes bytes,
long start,
long limit,
byte match,
boolean caseSensitive) |
static Bytes |
from(byte[] bytes) |
static Bytes |
from(String s) |
static String |
get(Bytes bytes,
Range range) |
static Range |
getByPrefix(Bytes bytes,
Ranges ranges,
byte[] prefix,
boolean caseSensitive) |
static byte[] |
getBytes(Bytes bytes,
Range range) |
static boolean |
match(Bytes bytes,
long start,
byte[] match,
boolean caseSensitive) |
static boolean |
match(Bytes bytes,
long start,
byte[] match,
int offset,
int length,
boolean caseSensitive) |
static boolean |
matches(Bytes bytes,
Range target,
byte[] match,
boolean caseSensitive) |
static boolean |
matchNoCase(Bytes bytes,
long start,
byte[] match,
int offset,
int length) |
static boolean |
matchSensitive(Bytes bytes,
long start,
byte[] match,
int offset,
int length) |
static long |
parseLine(Bytes bytes,
Range line,
long start,
long limit) |
static long |
parseLines(Bytes bytes,
Ranges lines,
long start,
long limit) |
static long |
parseLines(Bytes bytes,
Ranges lines,
org.rapidoid.wrap.LongWrap res,
long start,
long limit,
byte end1,
byte end2) |
static long |
scan(Bytes bytes,
long from,
long to,
byte value) |
static long |
scanLnAndMatchPrefix(Bytes bytes,
Range result,
long fromPos,
long toPos,
long 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 long |
scanNoCase(Bytes bytes,
long from,
long to,
byte value) |
static long |
scanUntilAndMatchPrefix(Bytes bytes,
Range result,
byte separator,
long fromPos,
long toPos,
long 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,
Range target,
byte sep,
Range before,
Range after,
boolean trimParts) |
static boolean |
startsWith(Bytes bytes,
Range target,
byte[] match,
boolean caseSensitive) |
static void |
trim(Bytes bytes,
Range target) |
public static Bytes from(byte[] bytes)
public static long parseLines(Bytes bytes, Ranges lines, org.rapidoid.wrap.LongWrap res, long start, long limit, byte end1, byte end2)
public static Range getByPrefix(Bytes bytes, Ranges ranges, byte[] prefix, boolean caseSensitive)
public static long scan(Bytes bytes, long from, long to, byte value)
public static long scanNoCase(Bytes bytes, long from, long to, byte value)
public static boolean match(Bytes bytes, long start, byte[] match, int offset, int length, boolean caseSensitive)
public static boolean matchNoCase(Bytes bytes, long start, byte[] match, int offset, int length)
public static boolean matchSensitive(Bytes bytes, long start, byte[] match, int offset, int length)
public static boolean match(Bytes bytes, long start, byte[] match, boolean caseSensitive)
public static long find(Bytes bytes, long start, long limit, byte match, boolean caseSensitive)
public static long find(Bytes bytes, long start, long limit, byte[] match, boolean caseSensitive)
public static long find(Bytes bytes, long start, long limit, byte[] match, int offset, int length, boolean caseSensitive)
public static boolean matches(Bytes bytes, Range target, byte[] match, boolean caseSensitive)
public static boolean startsWith(Bytes bytes, Range target, byte[] match, boolean caseSensitive)
public static boolean containsAt(Bytes bytes, Range target, long offset, byte[] match, boolean caseSensitive)
public static boolean split(Bytes bytes, Range target, byte sep, Range before, Range after, boolean trimParts)
public static long scanUntilAndMatchPrefix(Bytes bytes, Range result, byte separator, long fromPos, long toPos, long 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 long scanLnAndMatchPrefix(Bytes bytes, Range result, long fromPos, long toPos, long 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.Copyright © 2014–2015 Nikolche Mihajlovski and contributors. All rights reserved.