public final class AsciiEncoding extends Object
Modifier and Type | Field and Description |
---|---|
static byte[] |
MIN_INTEGER_VALUE
US-ASCII-encoded byte representation of the
Integer.MIN_VALUE . |
static byte[] |
MIN_LONG_VALUE
US-ASCII-encoded byte representation of the
Long.MIN_VALUE . |
static byte |
MINUS_SIGN
Byte value of the minus sign ('
- '). |
static byte |
ZERO
Byte value of zero character ('
0 '). |
Modifier and Type | Method and Description |
---|---|
static int |
endOffset(int value)
Get the end offset of an ASCII encoded value.
|
static int |
endOffset(long value)
Get the end offset of an ASCII encoded value.
|
static int |
getDigit(int index,
byte value)
Get the digit value of an ASCII encoded
byte . |
static int |
getDigit(int index,
char value)
Get the digit value of an ASCII encoded
char . |
static int |
parseIntAscii(CharSequence cs,
int index,
int length)
Parse an ASCII encoded int from a
CharSequence . |
static long |
parseLongAscii(CharSequence cs,
int index,
int length)
Parse an ASCII encoded long from a
CharSequence . |
public static final byte[] MIN_INTEGER_VALUE
Integer.MIN_VALUE
.public static final byte[] MIN_LONG_VALUE
Long.MIN_VALUE
.public static final byte MINUS_SIGN
-
').public static final byte ZERO
0
').public static int endOffset(int value)
value
- to find the end encoded character offset.public static int endOffset(long value)
value
- to find the end encoded character offset.public static int getDigit(int index, byte value)
byte
.index
- within the string the value is encoded.value
- of the encoding in ASCII.AsciiNumberFormatException
- if the value is not a digit.public static int getDigit(int index, char value)
char
.index
- within the string the value is encoded.value
- of the encoding in ASCII.AsciiNumberFormatException
- if the value is not a digit.public static int parseIntAscii(CharSequence cs, int index, int length)
CharSequence
.cs
- to parse.index
- at which the number begins.length
- of the encoded number in characters.AsciiNumberFormatException
- if cs
is not an int valueIndexOutOfBoundsException
- if parsing results in access outside string boundaries, or length is negativepublic static long parseLongAscii(CharSequence cs, int index, int length)
CharSequence
.cs
- to parse.index
- at which the number begins.length
- of the encoded number in characters.AsciiNumberFormatException
- if cs
is not a long valueIndexOutOfBoundsException
- if parsing results in access outside string boundaries, or length is negativeCopyright © 2014-2021 Real Logic Limited. All Rights Reserved.