本文整理匯總了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());
}