public class AsciiEncoding extends Object
Modifier and Type | Field and Description |
---|---|
static byte[] |
MIN_INTEGER_VALUE |
static byte[] |
MIN_LONG_VALUE |
static byte |
MINUS_SIGN |
static byte |
ZERO |
Constructor and Description |
---|
AsciiEncoding() |
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 ZERO
public static final byte[] MIN_INTEGER_VALUE
public static final byte[] MIN_LONG_VALUE
public static final byte MINUS_SIGN
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 cs
is emptypublic 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 cs
is emptyCopyright © 2014-2019 Real Logic Ltd. All Rights Reserved.