@PublicEvolving public class ByteParser extends FieldParser<Byte>
FieldParser.ParseErrorState
Constructor and Description |
---|
ByteParser() |
Modifier and Type | Method and Description |
---|---|
Byte |
createValue()
Returns an instance of the parsed value type.
|
Byte |
getLastResult()
Gets the parsed field.
|
static byte |
parseField(byte[] bytes,
int startPos,
int length)
Static utility to parse a field of type byte from a byte sequence that represents text
characters
(such as when read from a file stream).
|
int |
parseField(byte[] bytes,
int startPos,
int limit,
byte[] delimiter,
Byte reusable)
Parses the value of a field from the byte array.
|
static byte |
parseField(byte[] bytes,
int startPos,
int length,
char delimiter)
Static utility to parse a field of type byte from a byte sequence that represents text
characters
(such as when read from a file stream).
|
delimiterNext, getErrorState, getParserForType, setErrorState
public int parseField(byte[] bytes, int startPos, int limit, byte[] delimiter, Byte reusable)
FieldParser
parseField
in class FieldParser<Byte>
bytes
- The byte array that holds the value.startPos
- The index where the field startslimit
- The limit unto which the byte contents is valid for the parser. The limit is the
position one after the last valid byte.delimiter
- The field delimiter characterreusable
- An optional reusable field to hold the valuepublic Byte createValue()
FieldParser
createValue
in class FieldParser<Byte>
public Byte getLastResult()
FieldParser
FieldParser.parseField(byte[], int, int, byte[], Object)
. It objects are mutable and reused, it will return
the object instance that was passed the parse function.getLastResult
in class FieldParser<Byte>
public static final byte parseField(byte[] bytes, int startPos, int length)
bytes
- The bytes containing the text data that should be parsed.startPos
- The offset to start the parsing.length
- The length of the byte sequence (counting from the offset).NumberFormatException
- Thrown when the value cannot be parsed because the text
represents not a correct number.public static final byte parseField(byte[] bytes, int startPos, int length, char delimiter)
bytes
- The bytes containing the text data that should be parsed.startPos
- The offset to start the parsing.length
- The length of the byte sequence (counting from the offset).delimiter
- The delimiter that terminates the field.NumberFormatException
- Thrown when the value cannot be parsed because the text
represents not a correct number.Copyright © 2014–2017 The Apache Software Foundation. All rights reserved.