Example usage for io.netty.buffer ByteBuf writeMedium

List of usage examples for io.netty.buffer ByteBuf writeMedium

Introduction

In this page you can find the example usage for io.netty.buffer ByteBuf writeMedium.

Prototype

public abstract ByteBuf writeMedium(int value);

Source Link

Document

Sets the specified 24-bit medium integer at the current writerIndex and increases the writerIndex by 3 in this buffer.

Usage

From source file:sas.systems.imflux.packet.rtcp.ReceptionReport.java

License:Apache License

public static ByteBuf encode(ReceptionReport block) {
    ByteBuf buffer = Unpooled.buffer(24); // 4 + 1 + 3 + 4 + 4 + 4 + 4
    buffer.writeInt((int) block.ssrc);
    buffer.writeByte(block.fractionLost);
    buffer.writeMedium(block.cumulativeNumberOfPacketsLost);
    buffer.writeInt((int) block.extendedHighestSequenceNumberReceived);
    buffer.writeInt((int) block.interArrivalJitter);
    buffer.writeInt((int) block.lastSenderReport);
    buffer.writeInt((int) block.delaySinceLastSenderReport);
    return buffer;
}