@InternalApi public final class ByteArrayHelper extends java.lang.Object
| Modifier and Type | Method and Description |
|---|---|
static byte[] |
emptyByteArray() |
static byte[] |
fromBase64String(java.lang.String base64)
Decodes a base64 encoded string to a byte array.
|
static byte[] |
fromBase64urlString(java.lang.String base64url)
Decodes a base64url encoded string to a byte array.
|
static byte[] |
fromHexString(java.lang.String hexString)
Converts the provided hexadecimal string to a byte array.
|
static int |
indexOf(byte[] array,
byte b)
Returns the index of the first occurrence of
b in array. |
static java.lang.String |
toHexString(byte[] bytes)
Converts the provided byte array to a hexadecimal string
|
static void |
validateBufferLength(byte[] b,
int off,
int len)
Validates requested offset (
off) and length (len) against the array (b). |
public static java.lang.String toHexString(byte[] bytes)
Adapted from https://stackoverflow.com/a/21429909/466862 by higginse
bytes - byte array (not nullpublic static byte[] fromHexString(java.lang.String hexString)
hexString - Hexadecimal stringpublic static byte[] fromBase64String(java.lang.String base64)
base64 - Base64 encoded datapublic static byte[] fromBase64urlString(java.lang.String base64url)
Base64url applies the "URL and Filename safe" Base 64 Alphabet.
base64url - Base64url encoded datapublic static int indexOf(byte[] array,
byte b)
b in array.array - Array to searchb - byte to findb, or -1 if b is not in the arraypublic static byte[] emptyByteArray()
public static void validateBufferLength(byte[] b,
int off,
int len)
throws java.sql.SQLException
off) and length (len) against the array (b).b - arrayoff - position in arraylen - length from offjava.sql.SQLException - if off < 0, len < 0, or if off + len > b.lengthCopyright © 2001-2025 Jaybird (Firebird JDBC) team. All rights reserved.