Class Hex
java.lang.Object
aQute.lib.hex.Hex
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidappend(Appendable sb, byte ch) static final voidappend(Appendable sb, byte[] data) static voidappend(Appendable sb, char ch) static voidappend(Appendable sb, int ch) static voidappend(Appendable sb, long ch) static voidappend(Appendable sb, short ch) static Stringformat(byte[] data) Format a buffer to show the buffer in a table with 16 bytes per row, hex values and ascii values are shown.static Stringformat(ByteBuffer data) Format a buffer to show the buffer in a table with 16 bytes per row, hex values and ascii values are shown.static booleanisBinary(byte[] data) Check of a buffer is classified as binary or text.static booleanisBinary(ByteBuffer data) Check of a buffer is classified as binary or text.static booleanstatic booleanisHexCharacter(char c) static final intnibble(char c) static final charnibble(int i) static Stringstatic Stringstatic final byte[]toByteArray(String string) static StringtoHex(byte b) static final StringtoHexString(byte[] data)
-
Constructor Details
-
Hex
public Hex()
-
-
Method Details
-
toByteArray
-
toHex
-
nibble
public static final int nibble(char c) -
toHexString
-
append
- Throws:
IOException
-
nibble
public static final char nibble(int i) -
isHex
-
isHexCharacter
public static boolean isHexCharacter(char c) -
separated
-
separated
-
format
Format a buffer to show the buffer in a table with 16 bytes per row, hex values and ascii values are shown.- Parameters:
data- the buffer- Returns:
- a String with the formatted data
-
format
Format a buffer to show the buffer in a table with 16 bytes per row, hex values and ascii values are shown.- Parameters:
data- the buffer- Returns:
- a String with the formatted data
-
isBinary
public static boolean isBinary(byte[] data) Check of a buffer is classified as binary or text. We assume a file is binary of it contains a 0 byte. Heuristics may differ in the future, this method is really to collect this decision in one place.- Parameters:
data- the buffer- Returns:
- true of classified as binary
-
isBinary
Check of a buffer is classified as binary or text. We assume a file is binary of it contains a 0 byte. Heuristics may differ in the future, this method is really to collect this decision in one place.- Parameters:
data- the buffer- Returns:
- true of classified as binary
-
append
-
append
-
append
-
append
-
append
-