public class Util extends Object
Modifier and Type | Field and Description |
---|---|
static char[] |
HEX_DIGITS |
static long |
MS_PER_S |
static String |
NEW_LINE |
static long |
NS_PER_MS |
static long |
NS_PER_S |
Constructor and Description |
---|
Util() |
Modifier and Type | Method and Description |
---|---|
static String |
abridge(String s,
int maxLength) |
static void |
append(Appendable sb,
char c) |
static void |
append(Appendable sb,
CharSequence s) |
static void |
appendQuotedChar(Appendable sb,
int c) |
static void |
appendQuotedString(Appendable sb,
String s,
int start,
int length) |
static boolean |
bytesEqual(byte[] source,
int offset,
byte[] target)
Utility method to determine whether a subarray of bytes in a byte-array
source matches the byte-array in target . |
static void |
bytesToHex(Appendable sb,
byte[] bytes,
int offset,
int length) |
static String |
bytesToHex(byte[] bytes) |
static boolean |
changeByte(byte[] bytes,
int index,
byte value) |
static boolean |
changeBytes(byte[] bytes,
int index,
byte[] value) |
static boolean |
changeChar(byte[] bytes,
int index,
char value) |
static boolean |
changeInt(byte[] bytes,
int index,
int value) |
static boolean |
changeLong(byte[] bytes,
int index,
long value) |
static boolean |
changeShort(byte[] bytes,
int index,
short value) |
static void |
clearBytes(byte[] bytes,
int from,
int to) |
static String |
date(long t) |
static String |
dump(byte[] b,
int offset,
int size) |
static String |
dump(char[] c,
int offset,
int size) |
static String |
dump(KeyState ks) |
static String |
dump(ValueState vs) |
static boolean |
equalsByteSubarray(byte[] source,
int next,
byte[] target) |
static boolean |
equalsByteSubarray(byte[] source,
int soffset,
byte[] target,
int toffset,
int length) |
static void |
fill(StringBuilder sb,
long value,
int width) |
static void |
fill(StringBuilder sb,
String s,
int width) |
static String |
format(int i) |
static String |
format(long i) |
static String |
format(long i,
int width) |
static String |
format(String s,
int width,
boolean right) |
static int |
getByte(byte[] bytes,
int index) |
static int |
getChar(byte[] bytes,
int index) |
static int |
getInt(byte[] bytes,
int index) |
static long |
getLong(byte[] bytes,
int index) |
static int |
getShort(byte[] bytes,
int index) |
static Appendable |
hex(Appendable sb,
long value,
int length) |
static String |
hexDump(byte[] b) |
static String |
hexDump(byte[] b,
int offset,
int length) |
static byte[] |
hexToBytes(String hex) |
static boolean |
isValidName(String s) |
static Pattern |
pattern(String s,
boolean caseInsensitive) |
static void |
println(String template,
Object... args) |
static void |
putByte(byte[] bytes,
int index,
int value) |
static int |
putBytes(byte[] bytes,
int index,
byte[] value) |
static void |
putChar(byte[] bytes,
int index,
int value) |
static void |
putInt(byte[] bytes,
int index,
int value) |
static void |
putLong(byte[] bytes,
int index,
long value) |
static void |
putShort(byte[] bytes,
int index,
int value) |
static float |
rangeCheck(float value,
float min,
float max) |
static int |
rangeCheck(int value,
int min,
int max) |
static long |
rangeCheck(long value,
long min,
long max) |
static String |
replaceFileSuffix(String name,
String suffix) |
static void |
sleep(long millis) |
static void |
spinSleep() |
static byte[] |
stringToBytes(String s) |
static String |
toString(Object object) |
public static final String NEW_LINE
public static final long NS_PER_S
public static final long MS_PER_S
public static final long NS_PER_MS
public static final char[] HEX_DIGITS
public static int getByte(byte[] bytes, int index)
public static int getShort(byte[] bytes, int index)
public static int getChar(byte[] bytes, int index)
public static int getInt(byte[] bytes, int index)
public static long getLong(byte[] bytes, int index)
public static void putByte(byte[] bytes, int index, int value)
public static void putShort(byte[] bytes, int index, int value)
public static void putChar(byte[] bytes, int index, int value)
public static void putInt(byte[] bytes, int index, int value)
public static void putLong(byte[] bytes, int index, long value)
public static int putBytes(byte[] bytes, int index, byte[] value)
public static boolean changeBytes(byte[] bytes, int index, byte[] value)
public static boolean changeByte(byte[] bytes, int index, byte value)
public static boolean changeChar(byte[] bytes, int index, char value)
public static boolean changeShort(byte[] bytes, int index, short value)
public static boolean changeInt(byte[] bytes, int index, int value)
public static boolean changeLong(byte[] bytes, int index, long value)
public static String format(int i)
public static String format(long i)
public static String format(long i, int width)
public static boolean equalsByteSubarray(byte[] source, int next, byte[] target)
public static boolean equalsByteSubarray(byte[] source, int soffset, byte[] target, int toffset, int length)
public static void fill(StringBuilder sb, long value, int width)
public static void fill(StringBuilder sb, String s, int width)
public static String dump(ValueState vs)
public static String dump(byte[] b, int offset, int size)
public static String dump(char[] c, int offset, int size)
public static String hexDump(byte[] b)
public static String hexDump(byte[] b, int offset, int length)
public static Appendable hex(Appendable sb, long value, int length)
public static byte[] stringToBytes(String s)
public static boolean isValidName(String s)
public static String bytesToHex(byte[] bytes)
public static void bytesToHex(Appendable sb, byte[] bytes, int offset, int length)
public static byte[] hexToBytes(String hex)
public static void clearBytes(byte[] bytes, int from, int to)
public static void appendQuotedString(Appendable sb, String s, int start, int length)
public static void append(Appendable sb, char c)
public static void append(Appendable sb, CharSequence s)
public static void appendQuotedChar(Appendable sb, int c)
public static String date(long t)
public static boolean bytesEqual(byte[] source, int offset, byte[] target)
source
matches the byte-array in target
.source
- The source byte arrayoffset
- The offset of the sub-array within the source.target
- The target byte arraytrue
if the byte subarrays are equalpublic static void sleep(long millis) throws PersistitInterruptedException
PersistitInterruptedException
public static void spinSleep() throws PersistitInterruptedException
PersistitInterruptedException
public static int rangeCheck(int value, int min, int max)
public static long rangeCheck(long value, long min, long max)
public static float rangeCheck(float value, float min, float max)
Copyright © 2025 Open Identity Platform Community. All rights reserved.