public abstract class BinaryFunction
extends java.lang.Object
Basic functions for type binary
.
Constructor and Description |
---|
BinaryFunction() |
Modifier and Type | Method and Description |
---|---|
static byte |
byteAt(byte[] value,
int index)
Return the byte at
index in value . |
static int |
compareTo(byte[] value,
byte[] other)
Compare binary
value with other binary value. |
static int |
hashCode(byte[] value)
Return a hash code for
value . |
static int |
indexOf(byte[] value,
byte[] find)
|
static int |
indexOf(byte[] value,
byte[] find,
int start)
Locates
find within value , searching forwards from start . |
static byte[] |
slice(byte[] value,
int start)
|
static byte[] |
slice(byte[] value,
int start,
int end)
Return a section of
value beginning at start , through to end . |
static java.lang.String |
toString(byte[] value)
Return a string value with simple (numeric value) mapping of source bytes to target Unicode character values.
|
public static byte byteAt(byte[] value, int index)
Return the byte at index
in value
.
value
- Source value.index
- Zero-based index.index
in value
.public static int compareTo(byte[] value, byte[] other)
Compare binary value
with other
binary value.
value
- Source value.other
- Other string value for comparison.value < other
, zero result if value == other
, positive result if value > other
.public static int hashCode(byte[] value)
Return a hash code for value
.
value
- Source value.public static int indexOf(byte[] value, byte[] find)
public static int indexOf(byte[] value, byte[] find, int start)
Locates find
within value
, searching forwards from start
.
JavaScript String.prototype.indexOf.
value
- Source value.find
- Text to be located.start
- Optional start position (defaults to 0).public static byte[] slice(byte[] value, int start)
public static byte[] slice(byte[] value, int start, int end)
Return a section of value
beginning at start
, through to end
. Allows negative values for start
/ end
to specify end-relative positions.
value
- Source value.start
- The zero-based index at which to begin extraction from the source value. If negative, it is treated as value.length + start
.end
- Optional. The zero-based index at which to end extraction from the source value. If omitted, slice
extracts to the end of the value. If negative, it is treated as value.length + end
.value
beginning at start
, through to end
. Allows negative values for start
/ end
to specify end-relative positions.public static java.lang.String toString(byte[] value)
Return a string value with simple (numeric value) mapping of source bytes to target Unicode character values. Use only when character values are limited to ISO-8859-1 (the first 256 code points of Unicode).
value
- Source value.