本文整理汇总了Java中io.netty.buffer.ByteBuf.writeLongLE方法的典型用法代码示例。如果您正苦于以下问题:Java ByteBuf.writeLongLE方法的具体用法?Java ByteBuf.writeLongLE怎么用?Java ByteBuf.writeLongLE使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类io.netty.buffer.ByteBuf
的用法示例。
在下文中一共展示了ByteBuf.writeLongLE方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: encode
import io.netty.buffer.ByteBuf; //导入方法依赖的package包/类
@Override
public void encode(Packet msg, ByteBuf buf) {
AdventureSettingsPacket packet = (AdventureSettingsPacket) msg;
ByteBufUtils.writeUnsignedVarInt(buf, BitMaskValue.getBitMask(packet.getFlags()));
ByteBufUtils.writeUnsignedVarInt(buf, packet.getCommandPermissionLevel().getOrdinal());
ByteBufUtils.writeUnsignedVarInt(buf, BitMaskValue.getBitMask(packet.getAbilities()));
ByteBufUtils.writeUnsignedVarInt(buf, packet.getPlayerPermissionLevel().getOrdinal());
ByteBufUtils.writeUnsignedVarInt(buf, packet.getSavedPermissionLevel().getOrdinal());
buf.writeLongLE(packet.getEntityId());
}
示例2: writePackInfo
import io.netty.buffer.ByteBuf; //导入方法依赖的package包/类
public static void writePackInfo(ByteBuf serializer, ResourcePack pack) {
StringSerializer.writeString(serializer, ProtocolVersion.MINECRAFT_PE, pack.getPackId());
StringSerializer.writeString(serializer, ProtocolVersion.MINECRAFT_PE, pack.getPackVersion());
serializer.writeLongLE(pack.getPackSize());
StringSerializer.writeString(serializer, ProtocolVersion.MINECRAFT_PE, ""); // ???
StringSerializer.writeString(serializer, ProtocolVersion.MINECRAFT_PE, ""); // ???
}
示例3: toData
import io.netty.buffer.ByteBuf; //导入方法依赖的package包/类
@Override
public void toData(Connection connection, ByteBuf serializer) {
StringSerializer.writeString(serializer, ProtocolVersion.MINECRAFT_PE, packId);
serializer.writeIntLE(chunkIdx);
serializer.writeLongLE(StuffUtils.CHUNK_SIZE * chunkIdx);
serializer.writeIntLE(packChunk.length);
serializer.writeBytes(packChunk);
}
示例4: toData
import io.netty.buffer.ByteBuf; //导入方法依赖的package包/类
@Override
public void toData(Connection connection, ByteBuf serializer) {
StringSerializer.writeString(serializer, ProtocolVersion.MINECRAFT_PE, pack.getPackId());
serializer.writeIntLE(StuffUtils.CHUNK_SIZE); // max chunk size 1MB
serializer.writeIntLE(pack.getPackSize() / StuffUtils.CHUNK_SIZE); // chunk count
serializer.writeLongLE(pack.getPackSize()); // res pack size
byte[] hash = pack.getSha256();
VarNumberSerializer.writeVarInt(serializer, hash.length);
for (byte b : hash) {
serializer.writeByte(b);
}
}
示例5: toData
import io.netty.buffer.ByteBuf; //导入方法依赖的package包/类
@Override
public void toData(Connection connection, ByteBuf serializer) {
MiscSerializer.writeUUID(serializer, connection.getVersion(), uuid);
StringSerializer.writeString(serializer, connection.getVersion(), name);
VarNumberSerializer.writeSVarLong(serializer, entityId); // entity ID
VarNumberSerializer.writeVarLong(serializer, entityId); // runtime ID
MiscSerializer.writeLFloat(serializer, x); // x
MiscSerializer.writeLFloat(serializer, y); // y
MiscSerializer.writeLFloat(serializer, z); // z
MiscSerializer.writeLFloat(serializer, motionX); // motx
MiscSerializer.writeLFloat(serializer, motionY); // moty
MiscSerializer.writeLFloat(serializer, motionZ); // motz
MiscSerializer.writeLFloat(serializer, pitch); // pitch
MiscSerializer.writeLFloat(serializer, headYaw); // yaw
MiscSerializer.writeLFloat(serializer, yaw); // yaw
VarNumberSerializer.writeSVarInt(serializer, 0); // held item stack
EntityMetadata.encodeMeta(serializer, connection.getVersion(), I18NData.DEFAULT_LOCALE, metadata);
//adventure settings
VarNumberSerializer.writeVarInt(serializer, 0);
VarNumberSerializer.writeVarInt(serializer, 0);
VarNumberSerializer.writeVarInt(serializer, 0);
VarNumberSerializer.writeVarInt(serializer, 0);
VarNumberSerializer.writeVarInt(serializer, 0);
serializer.writeLongLE(0); //?
VarNumberSerializer.writeSVarInt(serializer, 0); //links, not used
}
示例6: encodeChat
import io.netty.buffer.ByteBuf; //导入方法依赖的package包/类
private void encodeChat(ByteBuf buf, ChatMessage message) {
writeString(buf, message.getSender());
writeString(buf, message.getMessage().encode());
buf.writeLongLE(message.getXuid());
}
示例7: encodeRaw
import io.netty.buffer.ByteBuf; //导入方法依赖的package包/类
private void encodeRaw(ByteBuf buf, RawMessage message) {
writeString(buf, message.getMessage().encode());
buf.writeLongLE(message.getXuid());
}