Package app.babylon.text
Class ByteString
java.lang.Object
app.babylon.text.ByteString
- All Implemented Interfaces:
ByteSequence,Comparable<ByteString>
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbytebyteAt(int index) charset()intcompareTo(ByteString other) decode(int start, int end) static ByteStringencode(CharSequence value, Charset charset) booleaninthashCode()booleanisEmpty()intlength()static ByteStringof(ByteSequence bytes) static ByteStringof(CharSequence value) static ByteStringof(CharSequence value, Charset charset) parseDecimal(int start, int end) Parses a decimal value from this byte string, preserving the parsed decimal scale.parseDecimal(int start, int end, boolean stripTrailingZeros) Parses a decimal value from this byte string.intparseInt(int start, int end) longparseLong(int start, int end) parseString(int start, int end) subSequence(int start, int end) byte[]toString()Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface app.babylon.text.ByteSequence
decode
-
Constructor Details
-
ByteString
-
ByteString
-
-
Method Details
-
of
-
of
-
of
-
encode
-
length
public int length()- Specified by:
lengthin interfaceByteSequence
-
isEmpty
public boolean isEmpty() -
byteAt
public byte byteAt(int index) - Specified by:
byteAtin interfaceByteSequence
-
toByteArray
public byte[] toByteArray() -
subSequence
- Specified by:
subSequencein interfaceByteSequence
-
charset
- Specified by:
charsetin interfaceByteSequence
-
decode
-
decode
-
decode
- Specified by:
decodein interfaceByteSequence
-
parseString
-
parseInt
public int parseInt(int start, int end) -
parseLong
public long parseLong(int start, int end) -
parseDecimal
Parses a decimal value from this byte string, preserving the parsed decimal scale.Use
parseDecimal(int, int, boolean)to strip trailing zeros.- Parameters:
start- inclusive start indexend- exclusive end index- Returns:
- parsed decimal or
null
-
parseDecimal
Parses a decimal value from this byte string.- Parameters:
start- inclusive start indexend- exclusive end indexstripTrailingZeros- whether to normalise the parsed decimal by stripping trailing zeros- Returns:
- parsed decimal or
null
-
compareTo
- Specified by:
compareToin interfaceComparable<ByteString>
-
equals
-
hashCode
public int hashCode() -
toString
-
toHexString
-