public class Misc
extends java.lang.Object
| Constructor and Description |
|---|
Misc() |
| Modifier and Type | Method and Description |
|---|---|
static java.lang.String |
bytes2Hex(byte[] b)
Convert a byte array into a hex string.
|
static void |
dump(java.io.OutputStream out,
byte[] b)
helper fx to dump to stdout.
|
static void |
dump(java.io.PrintWriter ps,
java.lang.String s,
byte[] bb,
int offset,
int len)
Dump a byte array as hex values.
|
static void |
dump(java.lang.String title,
java.io.OutputStream out,
byte[] b)
helper fx to dump to stdout.
|
static void |
dump(java.lang.String title,
java.io.OutputStream out,
byte[] b,
int len)
helper fx to dump to stdout.
|
static void |
dump(java.lang.String title,
java.io.OutputStream out,
byte[] b,
int offset,
int len)
helper fx to dump to stdout.
|
static boolean |
equals(byte[] a,
byte[] b)
Compares one byte array with another byte array.
|
static boolean |
equals(byte[] a,
int aOff,
byte[] b,
int bOff,
int len)
Compares one segment of a byte array with a segment of a 2nd byte array.
|
static boolean |
equals(int[] a,
int[] b) |
static boolean |
equals(int[] a,
int aOff,
int[] b,
int bOff,
int len) |
static byte[] |
hex2Bytes(java.lang.String s)
Interpret the String as hex values and convert it to a byte array.
|
static java.lang.String |
replaceAll(java.lang.String string,
char c,
char d)
Helper method to replace all occurencies of a character to a different character.
|
public static final boolean equals(byte[] a,
int aOff,
byte[] b,
int bOff,
int len)
a - first byte arrayaOff - offset into first byte arrayb - second byte arraybOff - offset into second byte arraylen - length of the compared segmentspublic static final boolean equals(int[] a,
int aOff,
int[] b,
int bOff,
int len)
public static final boolean equals(byte[] a,
byte[] b)
a - first byte arrayb - second byte arraypublic static final boolean equals(int[] a,
int[] b)
public static byte[] hex2Bytes(java.lang.String s)
"abcd" -> { (byte)0xab, (byte)0xcd }
s - the stringpublic static java.lang.String bytes2Hex(byte[] b)
{ (byte)0xab, (byte)0xcd } -> "abcd"
b - the byte arraypublic static java.lang.String replaceAll(java.lang.String string,
char c,
char d)
string - a string - not nullc - the character to be replacedd - the replacementpublic static final void dump(java.io.PrintWriter ps,
java.lang.String s,
byte[] bb,
int offset,
int len)
ps - the used PrintWriter.s - a headline for each dumped block.bb - the byte array to displayoffset - offset into that arraylen - the count of the dumped bytes.public static void dump(java.io.OutputStream out,
byte[] b)
out - - some outputStreamb - - the bytes to dumppublic static void dump(java.lang.String title,
java.io.OutputStream out,
byte[] b)
title - title for the dump messageout - - some outputStreamb - - the bytes to dumppublic static void dump(java.lang.String title,
java.io.OutputStream out,
byte[] b,
int len)
title - title for the dump messageout - - some outputStreamb - - the bytes to dumplen - the length to dumppublic static void dump(java.lang.String title,
java.io.OutputStream out,
byte[] b,
int offset,
int len)
title - title for the dump messageout - - some outputStreamb - - the bytes to dumpoffset - offset into the datalen - the length to dump