|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectde.bb.util.Misc
public class Misc
Provides some useful functions to deal with byte arrays.
| Constructor Summary | |
|---|---|
Misc()
|
|
| Method Summary | |
|---|---|
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 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. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Misc()
| Method Detail |
|---|
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 segments
public static final boolean equals(byte[] a,
byte[] b)
a - first byte arrayb - second byte array
public static byte[] hex2Bytes(java.lang.String s)
"abcd" -> { (byte)0xab, (byte)0xcd }
s - the string
public static java.lang.String bytes2Hex(byte[] b)
{ (byte)0xab, (byte)0xcd } -> "abcd"
b - the byte array
public static java.lang.String replaceAll(java.lang.String string,
char c,
char d)
string - a string - not nullc - the character to be replacedd - the replacement
public 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 dump
public static void dump(java.lang.String title,
java.io.OutputStream out,
byte[] b)
title - title for the dump messageout - - some outputStreamb - - the bytes to dump
public 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 dump
public 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
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||