本文整理汇总了C++中PacketWriter::size方法的典型用法代码示例。如果您正苦于以下问题:C++ PacketWriter::size方法的具体用法?C++ PacketWriter::size怎么用?C++ PacketWriter::size使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PacketWriter
的用法示例。
在下文中一共展示了PacketWriter::size方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Encode
void RTMFP::Encode(RTMFPEngine& aesEncrypt,PacketWriter& packet) {
// paddingBytesLength=(0xffffffff-plainRequestLength+5)&0x0F
int paddingBytesLength = (0xFFFFFFFF-packet.size()+5)&0x0F;
// Padd the plain request with paddingBytesLength of value 0xff at the end
while (paddingBytesLength-->0)
packet.write8(0xFF);
WriteCRC(packet);
// Encrypt the resulted request
aesEncrypt.process(packet.data()+4,(UInt8*)packet.data()+4,packet.size()-4);
}
示例2: Pack
void RTMFP::Pack(PacketWriter& packet,UInt32 farId) {
PacketReader reader(packet.data(),packet.size());
reader.next(4);
BinaryWriter(packet.data(),4).write32(reader.read32()^reader.read32()^farId);
}
示例3: WriteCRC
void RTMFP::WriteCRC(PacketWriter& packet) {
// Compute the CRC and add it at the beginning of the request
PacketReader reader(packet.data(),packet.size());
reader.next(6);
BinaryWriter(packet.data()+4,2).write16(CheckSum(reader));
}