public class NBTCodec extends Object
| Constructor and Description |
|---|
NBTCodec(ByteOrder order)
Creates a NBTCodec object with a given byte order.
|
| Modifier and Type | Method and Description |
|---|---|
static NBTTag |
createTag(byte id)
Attempts to create an NBTTag given a type ID.
|
NBTTag |
decode(io.netty.buffer.ByteBuf buf,
NBTCompression compression)
Decodes a
NBTTag from a given ByteBuf, using a specified NBTCompression method. |
NBTTag |
decode(InputStream in,
NBTCompression compression)
Decodes a
NBTTag from a given InputStream, using a specified NBTCompression method. |
void |
encode(io.netty.buffer.ByteBuf buf,
NBTTag tag,
NBTCompression compression)
Encodes an
NBTTag to a given ByteBuf, using a specified NBTCompression method. |
void |
encode(OutputStream out,
NBTTag tag,
NBTCompression compression)
Encodes an
NBTTag to a given OutputStream, using a specified NBTCompression method. |
static byte[] |
toByteArray(io.netty.buffer.ByteBuf buf)
Gets a byte array representing the contents of a given ByteBuf.
|
public NBTCodec(ByteOrder order)
order - The byte order.public static NBTTag createTag(byte id)
id - The type ID.public NBTTag decode(io.netty.buffer.ByteBuf buf, NBTCompression compression)
NBTTag from a given ByteBuf, using a specified NBTCompression method.buf - The buffer to decode from.compression - The compression method used.public NBTTag decode(InputStream in, NBTCompression compression)
NBTTag from a given InputStream, using a specified NBTCompression method.in - The input stream to decode from.compression - The compression method used.public void encode(io.netty.buffer.ByteBuf buf,
NBTTag tag,
NBTCompression compression)
NBTTag to a given ByteBuf, using a specified NBTCompression method.buf - The buffer to encode to.tag - The tag to be encoded.compression - The compression method to be used.public void encode(OutputStream out, NBTTag tag, NBTCompression compression)
NBTTag to a given OutputStream, using a specified NBTCompression method.out - The output stream to encode to.tag - The tag to be encoded.compression - The compression method to be used.public static byte[] toByteArray(io.netty.buffer.ByteBuf buf)
buf - The ByteBuf.Copyright © 2017. All rights reserved.