@InterfaceAudience.Private @InterfaceStability.Evolving public class Tag extends Object
Modifier and Type | Field and Description |
---|---|
static int |
INFRASTRUCTURE_SIZE |
static int |
MAX_TAG_LENGTH |
static int |
TAG_LENGTH_SIZE |
static int |
TYPE_LENGTH_SIZE |
Constructor and Description |
---|
Tag(byte[] bytes,
int offset)
Creates a Tag from the specified byte array and offset.
|
Tag(byte[] bytes,
int offset,
int length)
Creates a Tag from the specified byte array, starting at offset, and for length
length . |
Tag(byte tagType,
byte[] tag) |
Tag(byte tagType,
String tag) |
Modifier and Type | Method and Description |
---|---|
static List<Tag> |
asList(byte[] b,
int offset,
int length)
Creates the list of tags from the byte array b.
|
static List<Tag> |
carryForwardTags(Cell cell) |
static List<Tag> |
carryForwardTags(List<Tag> tagsOrNull,
Cell cell) |
static byte[] |
fromList(List<Tag> tags)
Write a list of tags into a byte array
|
byte[] |
getBuffer() |
static Tag |
getTag(byte[] b,
int offset,
int length,
byte type)
Retrieve the first tag from the tags byte array matching the passed in tag type
|
int |
getTagLength() |
int |
getTagOffset() |
byte |
getType() |
byte[] |
getValue()
Returns tag value in a new byte array.
|
public static final int TYPE_LENGTH_SIZE
public static final int TAG_LENGTH_SIZE
public static final int INFRASTRUCTURE_SIZE
public static final int MAX_TAG_LENGTH
public Tag(byte tagType, String tag)
public Tag(byte tagType, byte[] tag)
tagType
- tag
- public Tag(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.bytes
- byte arrayoffset
- offset to start of Tagpublic Tag(byte[] bytes, int offset, int length)
length
. Presumes bytes
content starting at offset
is
formatted as a Tag blob.bytes
- byte arrayoffset
- offset to start of the Taglength
- length of the Tagpublic byte[] getBuffer()
public byte getType()
public int getTagLength()
public int getTagOffset()
public byte[] getValue()
getBuffer()
with appropriate getTagOffset()
and getTagLength()
instead to save on allocations.public static List<Tag> asList(byte[] b, int offset, int length)
b
- offset
- length
- public static byte[] fromList(List<Tag> tags)
tags
- public static Tag getTag(byte[] b, int offset, int length, byte type)
b
- offset
- length
- type
- public static List<Tag> carryForwardTags(Cell cell)
cell
else null.Copyright © 2007-2016 The Apache Software Foundation. All Rights Reserved.