Package mondrian.util
Class ByteString
java.lang.Object
mondrian.util.ByteString
- All Implemented Interfaces:
Serializable
,Comparable<ByteString>
Collection of bytes.
ByteString is to bytes what String
is to chars: It is immutable,
implements equality (hashCode and equals), comparison (compareTo) and
serialization correctly.
- Author:
- jhyde
- See Also:
-
Constructor Summary
-
Method Summary
-
Constructor Details
-
ByteString
public ByteString(byte[] bytes) Creates a ByteString.- Parameters:
bytes
- Bytes
-
-
Method Details
-
hashCode
public int hashCode() -
equals
-
compareTo
- Specified by:
compareTo
in interfaceComparable<ByteString>
-
toString
Returns this byte string in hexadecimal format. -
clone
-
length
public int length()Returns the number of bytes in this byte string.- Returns:
- Length of this byte string
-
byteAt
public byte byteAt(int i) Returns the byte at a given position in the byte string.- Parameters:
i
- Index- Returns:
- Byte at given position
- Throws:
IndexOutOfBoundsException
- if the index argument is negative or not less than length()
-