Package mondrian.util
Class ByteString
- java.lang.Object
-
- mondrian.util.ByteString
-
- All Implemented Interfaces:
Serializable,Comparable<ByteString>
public class ByteString extends Object implements Comparable<ByteString>, Serializable
Collection of bytes.ByteString is to bytes what
Stringis to chars: It is immutable, implements equality (hashCode and equals), comparison (compareTo) and serialization correctly.- Author:
- jhyde
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description ByteString(byte[] bytes)Creates a ByteString.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description bytebyteAt(int i)Returns the byte at a given position in the byte string.Objectclone()intcompareTo(ByteString that)booleanequals(Object obj)inthashCode()intlength()Returns the number of bytes in this byte string.StringtoString()Returns this byte string in hexadecimal format.
-
-
-
Method Detail
-
compareTo
public int compareTo(ByteString that)
- Specified by:
compareToin interfaceComparable<ByteString>
-
toString
public String toString()
Returns this byte string in hexadecimal format.
-
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()
-
-