當前位置: 首頁>>代碼示例>>Java>>正文


Java ByteBuf.writeLongLE方法代碼示例

本文整理匯總了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());
}
 
開發者ID:JungleTree,項目名稱:JungleTree,代碼行數:11,代碼來源:AdventureSettingsCodec.java

示例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, ""); // ???
}
 
開發者ID:ProtocolSupport,項目名稱:ProtocolSupportPocketStuff,代碼行數:8,代碼來源:ResourcePackSerializer.java

示例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);
}
 
開發者ID:ProtocolSupport,項目名稱:ProtocolSupportPocketStuff,代碼行數:9,代碼來源:ResourcePackChunkDataPacket.java

示例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);
	}
}
 
開發者ID:ProtocolSupport,項目名稱:ProtocolSupportPocketStuff,代碼行數:15,代碼來源:ResourcePackDataInfoPacket.java

示例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
}
 
開發者ID:ProtocolSupport,項目名稱:ProtocolSupportPocketStuff,代碼行數:32,代碼來源:SpawnPlayerPacket.java

示例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());
}
 
開發者ID:JungleTree,項目名稱:JungleTree,代碼行數:6,代碼來源:TextMessageCodec.java

示例7: encodeRaw

import io.netty.buffer.ByteBuf; //導入方法依賴的package包/類
private void encodeRaw(ByteBuf buf, RawMessage message) {
    writeString(buf, message.getMessage().encode());
    buf.writeLongLE(message.getXuid());
}
 
開發者ID:JungleTree,項目名稱:JungleTree,代碼行數:5,代碼來源:TextMessageCodec.java


注:本文中的io.netty.buffer.ByteBuf.writeLongLE方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。