CUSTOM_TAG_TYPE_RANGE, INFRASTRUCTURE_SIZE, MAX_TAG_LENGTH, TAG_LENGTH_SIZE, TYPE_LENGTH_SIZE| Constructor and Description |
|---|
ArrayBackedTag(byte[] bytes,
int offset)
Creates a Tag from the specified byte array and offset.
|
ArrayBackedTag(byte[] bytes,
int offset,
int length)
Creates a Tag from the specified byte array, starting at offset, and for length
length. |
ArrayBackedTag(byte tagType,
byte[] tag)
Format for a tag :
<length of tag - 2 bytes><type code - 1 byte><tag> tag length is
serialized using 2 bytes only but as this will be unsigned, we can have max tag length of
(Short.MAX_SIZE * 2) +1. |
ArrayBackedTag(byte tagType,
String tag)
The special tag will write the length of each tag and that will be followed by the type and
then the actual tag.
|
| Modifier and Type | Method and Description |
|---|---|
byte |
getType()
Returns the tag type
|
byte[] |
getValueArray()
Returns The byte array backing this Tag.
|
ByteBuffer |
getValueByteBuffer()
Returns The
ByteBuffer containing the value bytes. |
int |
getValueLength()
Returns Length of actual tag bytes within the backed buffer
|
int |
getValueOffset()
Returns Offset of actual tag bytes within the backed buffer
|
boolean |
hasArray()
Tells whether or not this Tag is backed by a byte array.
|
String |
toString() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitcloneValue, copyValueTo, getValueAsByte, getValueAsLong, getValueAsString, matchingValuepublic ArrayBackedTag(byte tagType,
String tag)
public ArrayBackedTag(byte tagType,
byte[] tag)
<length of tag - 2 bytes><type code - 1 byte><tag> tag length is
serialized using 2 bytes only but as this will be unsigned, we can have max tag length of
(Short.MAX_SIZE * 2) +1. It includes 1 byte type length and actual tag bytes length.public ArrayBackedTag(byte[] bytes,
int offset)
bytes content
starting at offset is formatted as a Tag blob. The bytes to include the tag type,
tag length and actual tag bytes.offset - offset to start of Tagpublic ArrayBackedTag(byte[] bytes,
int offset,
int length)
length. Presumes bytes content starting at offset is
formatted as a Tag blob.public byte[] getValueArray()
getValueArray in interface TagTag.hasArray() return false. Use
Tag.getValueByteBuffer() in such situationpublic int getValueLength()
getValueLength in interface Tagpublic int getValueOffset()
getValueOffset in interface Tagpublic boolean hasArray()
Tagpublic ByteBuffer getValueByteBuffer()
TagByteBuffer containing the value bytes.getValueByteBuffer in interface TagCopyright © 2007–2020 The Apache Software Foundation. All rights reserved.