Package net.md_5.bungee.nbt
Interface Tag
- All Known Subinterfaces:
TypedTag
- All Known Implementing Classes:
ByteArrayTag,ByteTag,CompoundTag,DoubleTag,EndTag,FloatTag,IntArrayTag,IntTag,ListTag,LongArrayTag,LongTag,NamedTag,ShortTag,StringTag
public interface Tag
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intstatic final bytestatic final bytestatic final bytestatic final bytestatic final bytestatic final bytestatic final bytestatic final bytestatic final bytestatic final bytestatic final bytestatic final intstatic final intstatic final bytestatic final bytestatic final int -
Method Summary
Modifier and TypeMethodDescriptionstatic TypedTagfromByteArray(byte[] data) Deserializes the given byte array into aTypedTag.static TypedTagfromByteArray(byte[] data, NBTLimiter limiter) Deserializes the given byte array into aTypedTag, with limitations of theNBTLimiter.voidread(DataInput input, NBTLimiter limiter) Reads the data into this tag.static TypedTagreadById(byte id, DataInput input, NBTLimiter limiter) Reads aTagfrom the givenDataInput, based on the specified tag type, with limitations of theNBTLimiter.static NamedTagreadNamedTag(DataInput input, NBTLimiter limiter) static byte[]toByteArray(TypedTag tag) Serializes the givenTypedTaginto a byte array.voidwrite(DataOutput output) Writes this tag into aDataOutput.
-
Field Details
-
OBJECT_HEADER
static final int OBJECT_HEADER- See Also:
-
ARRAY_HEADER
static final int ARRAY_HEADER- See Also:
-
STRING_SIZE
static final int STRING_SIZE- See Also:
-
OBJECT_REFERENCE
static final int OBJECT_REFERENCE- See Also:
-
CONSTRUCTORS
-
END
static final byte END- See Also:
-
BYTE
static final byte BYTE- See Also:
-
SHORT
static final byte SHORT- See Also:
-
INT
static final byte INT- See Also:
-
LONG
static final byte LONG- See Also:
-
FLOAT
static final byte FLOAT- See Also:
-
DOUBLE
static final byte DOUBLE- See Also:
-
BYTE_ARRAY
static final byte BYTE_ARRAY- See Also:
-
STRING
static final byte STRING- See Also:
-
LIST
static final byte LIST- See Also:
-
COMPOUND
static final byte COMPOUND- See Also:
-
INT_ARRAY
static final byte INT_ARRAY- See Also:
-
LONG_ARRAY
static final byte LONG_ARRAY- See Also:
-
-
Method Details
-
read
Reads the data into this tag.- Parameters:
input- the input to read fromlimiter- the limiter for this read operation- Throws:
IOException- if an exception occurs during io operations
-
write
Writes this tag into aDataOutput.- Parameters:
output- the output to write to- Throws:
IOException- if an exception occurs during io operations
-
readById
Reads aTagfrom the givenDataInput, based on the specified tag type, with limitations of theNBTLimiter.- Parameters:
id- the nbt typeinput- the input to read fromlimiter- the limiter for this read operation- Returns:
- the deserialized
Tag - Throws:
IOException- if an exception occurs during io operations
-
readNamedTag
- Parameters:
input- the data input to read fromlimiter- the limiter for this read operation- Returns:
- the deserialized
NamedTag - Throws:
IOException- if an exception occurs during io operations
-
toByteArray
Serializes the givenTypedTaginto a byte array. This is the inverse operation offromByteArray(byte[]).- Parameters:
tag- the tag to convert- Returns:
- the serialized byte array
- Throws:
IOException- if an exception occurs during io operations
-
fromByteArray
Deserializes the given byte array into aTypedTag. This is the inverse operation oftoByteArray(TypedTag).- Parameters:
data- the byte array to read from- Returns:
- the deserialized
TypedTag - Throws:
IOException- if an exception occurs during io operations
-
fromByteArray
Deserializes the given byte array into aTypedTag, with limitations of theNBTLimiter.- Parameters:
data- the byte array to read fromlimiter- the limiter for this read operation- Returns:
- the deserialized
TypedTag - Throws:
IOException- if an exception occurs during io operations
-