Package org.dmfs.jems2.charsequence
Class Hex
java.lang.Object
org.dmfs.jems2.charsequence.Hex
- All Implemented Interfaces:
CharSequence
The hexadecimal
CharSequence representation of a byte array. The digits a-f will be represented by lower case letters.
Example:
assertEquals(
new Hex(new byte[{0x01, 0x23, 0x45, 0x67, (byte) 0x89, (byte) 0xab, (byte) 0xcd, (byte) 0xef }).toString(),
"0123456789abcdef");
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncharcharAt(int index) intlength()subSequence(int start, int end) toString()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface java.lang.CharSequence
chars, codePoints, isEmpty
-
Constructor Details
-
Hex
public Hex(byte[] binaryData) -
Hex
public Hex(byte[] binaryData, int start, int end)
-
-
Method Details
-
length
public int length()- Specified by:
lengthin interfaceCharSequence
-
charAt
public char charAt(int index) - Specified by:
charAtin interfaceCharSequence
-
subSequence
- Specified by:
subSequencein interfaceCharSequence
-
toString
- Specified by:
toStringin interfaceCharSequence- Overrides:
toStringin classObject
-