Package org.simpleframework.http.message
Class SegmentConsumer.Token
java.lang.Object
org.simpleframework.http.message.SegmentConsumer.Token
- Enclosing class:
SegmentConsumer
This is used to track the boundaries of a token so that it can
be converted in to a usable string. This will track the length
and offset within the consumed array of the token. When the
token is to be used it can be converted in to a string.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
-
Field Details
-
size
public int sizeThis is used to track the number of bytes within the array. -
off
public int offThis is used to mark the start offset within the array.
-
-
Constructor Details
-
Token
public Token(int off, int size) Constructor for theToken
object. This is used to create a new token to track the range of bytes that will be used to create a string representing the parsed value.- Parameters:
off
- the starting offset for the token rangesize
- the number of bytes used for the token
-
-
Method Details
-
text
This is used to convert the byte range to a string. This will use UTF-8 encoding for the string which is compatible with the HTTP default header encoding of ISO-8859-1.- Returns:
- the encoded string representing the token
-
text
This is used to convert the byte range to a string. This will use specified encoding, if that encoding is not supported then this will return null for the token value.- Returns:
- the encoded string representing the token
-