@InterfaceAudience.LimitedPrivate(value="Coprocesssor") @InterfaceStability.Evolving public interface Tag
Each Tag is having a type (one byte) and value part. The max value length for a Tag is 65533.
See TagType
for reserved tag types.
Modifier and Type | Field and Description |
---|---|
static byte |
CUSTOM_TAG_TYPE_RANGE
Custom tags if created are suggested to be above this range.
|
static int |
INFRASTRUCTURE_SIZE |
static int |
MAX_TAG_LENGTH |
static int |
TAG_LENGTH_SIZE |
static int |
TYPE_LENGTH_SIZE |
Modifier and Type | Method and Description |
---|---|
static byte[] |
cloneValue(Tag tag)
Returns tag value in a new byte array.
|
static void |
copyValueTo(Tag tag,
byte[] out,
int offset)
Copies the tag's value bytes to the given byte array
|
byte |
getType() |
byte[] |
getValueArray() |
static byte |
getValueAsByte(Tag tag)
Converts the value bytes of the given tag into a byte value
|
static long |
getValueAsLong(Tag tag)
Converts the value bytes of the given tag into a long value
|
static String |
getValueAsString(Tag tag)
Converts the value bytes of the given tag into a String value
|
ByteBuffer |
getValueByteBuffer() |
int |
getValueLength() |
int |
getValueOffset() |
boolean |
hasArray()
Tells whether or not this Tag is backed by a byte array.
|
static boolean |
matchingValue(Tag t1,
Tag t2)
Matches the value part of given tags
|
static final int TYPE_LENGTH_SIZE
static final int TAG_LENGTH_SIZE
static final int INFRASTRUCTURE_SIZE
static final int MAX_TAG_LENGTH
static final byte CUSTOM_TAG_TYPE_RANGE
byte getType()
int getValueOffset()
int getValueLength()
boolean hasArray()
byte[] getValueArray()
UnsupportedOperationException
- when hasArray()
return false. Use getValueByteBuffer()
in such
situationByteBuffer getValueByteBuffer()
ByteBuffer
containing the value bytes.static byte[] cloneValue(Tag tag)
getValueArray()
with appropriate getValueOffset()
and
getValueLength()
instead to save on allocations.tag
- The Tag whose value to be returnedstatic String getValueAsString(Tag tag)
tag
- The Tagstatic boolean matchingValue(Tag t1, Tag t2)
t1
- Tag to match the valuet2
- Tag to match the valuestatic void copyValueTo(Tag tag, byte[] out, int offset)
tag
- The Tagout
- The byte array where to copy the Tag value.offset
- The offset within 'out' array where to copy the Tag value.static long getValueAsLong(Tag tag)
tag
- The Tagstatic byte getValueAsByte(Tag tag)
tag
- The TagCopyright © 2007–2019 The Apache Software Foundation. All rights reserved.