类 NBukkitByteBuf
java.lang.Object
cn.afternode.commons.bukkit.messaging.NBukkitByteBuf
Netty version of BukkitByteBuffer
No need to shade netty, it's provided by server
No need to shade netty, it's provided by server
-
构造器概要
构造器 -
方法概要
修饰符和类型方法说明io.netty.buffer.ByteBufdirect()Access to source netty ByteBuf directlyvoidread(byte[] dest) Read byte arraybyte[]read(int size) Read byte array with specified sizebyte[]Read byte array in a blockbyte[]Read byte array in a large block<T extends Enum<?>>
TRead enumeration object (1 short integer)intreadInt()Read integerorg.bukkit.inventory.ItemStackRead item stack with BukkitObjectInputStreamlongreadLong()Read long integerorg.bukkit.entity.PlayerRead player (UUID)org.bukkit.OfflinePlayerRead player (UUID)shortRead shortRead UTF-8 StringreadUUID()Read UUID (2 long integers)byte[]toArray()Convert to byte arrayvoidwrite(byte[] data) Write byte arrayvoidwriteBlock(byte[] data) Write byte array in a blockvoidwriteBlockL(byte[] data) Write byte array in a large blockvoidWrite enumeration object (1 short integer)voidwriteInt(int data) Write integervoidwriteItemStack(org.bukkit.inventory.ItemStack item) Write item stack with BukkitObjectOutputStreamvoidwriteLong(long data) Write long integervoidwritePlayer(org.bukkit.OfflinePlayer player) Write player (UUID)voidwriteShort(short data) Write shortvoidwriteString(String data) Write UTF-8 stringvoidWrite UUID (2 long integers)
-
构造器详细资料
-
NBukkitByteBuf
public NBukkitByteBuf(byte[] data) -
NBukkitByteBuf
public NBukkitByteBuf()
-
-
方法详细资料
-
read
public void read(byte[] dest) Read byte array- 参数:
dest- Destination
-
write
public void write(byte[] data) Write byte array- 参数:
data- Data
-
read
public byte[] read(int size) Read byte array with specified size- 参数:
size- Size- 返回:
- Result
-
readBlock
public byte[] readBlock()Read byte array in a block- 返回:
- Result
-
writeBlock
public void writeBlock(byte[] data) Write byte array in a block- 参数:
data- Block
-
readBlockL
public byte[] readBlockL()Read byte array in a large block- 返回:
- Result
-
writeBlockL
public void writeBlockL(byte[] data) Write byte array in a large block- 参数:
data- Data
-
readShort
public short readShort()Read short- 返回:
- result
-
writeShort
public void writeShort(short data) Write short- 参数:
data- data
-
readInt
public int readInt()Read integer- 返回:
- result
-
writeInt
public void writeInt(int data) Write integer- 参数:
data- result
-
readLong
public long readLong()Read long integer- 返回:
- result
-
writeLong
public void writeLong(long data) Write long integer- 参数:
data- data
-
readString
Read UTF-8 String- 返回:
- result
-
writeString
Write UTF-8 string- 参数:
data- data
-
writeEnum
Write enumeration object (1 short integer)- 参数:
e- object
-
readEnum
Read enumeration object (1 short integer)- 类型参数:
T- Type- 参数:
clazz- Type- 返回:
- result
-
readUUID
Read UUID (2 long integers)- 返回:
- result
-
writeUUID
Write UUID (2 long integers)- 参数:
uuid- object
-
readPlayer
public org.bukkit.entity.Player readPlayer()Read player (UUID)- 返回:
- result (online only)
-
readPlayerOffline
public org.bukkit.OfflinePlayer readPlayerOffline()Read player (UUID)- 返回:
- result (online or offline)
-
writePlayer
public void writePlayer(org.bukkit.OfflinePlayer player) Write player (UUID)- 参数:
player- result
-
readItemStack
Read item stack with BukkitObjectInputStream- 返回:
- result
- 抛出:
IOException- ObjectInputStream errorClassNotFoundException- ObjectInputStream error- 另请参阅:
-
BukkitObjectInputStream
-
writeItemStack
Write item stack with BukkitObjectOutputStream- 参数:
item- item- 抛出:
IOException- ObjectInputStream error- 另请参阅:
-
BukkitObjectInputStream
-
direct
public io.netty.buffer.ByteBuf direct()Access to source netty ByteBuf directly- 返回:
- source
-
toArray
public byte[] toArray()Convert to byte array- 返回:
- result
-