Package org.apache.bookkeeper.proto
Class BookieProtocol.PacketHeader
java.lang.Object
org.apache.bookkeeper.proto.BookieProtocol.PacketHeader
- Enclosing interface:
- BookieProtocol
The first int of a packet is the header.
It contains the version, opCode and flags.
The initial versions of BK didn't have this structure
and just had an int representing the opCode as the
first int. This handles that case also.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic shortgetFlags(int packetHeader) static bytegetOpCode(int packetHeader) static bytegetVersion(int packetHeader) static inttoInt(byte version, byte opCode, short flags)
-
Constructor Details
-
PacketHeader
public PacketHeader()
-
-
Method Details
-
toInt
public static int toInt(byte version, byte opCode, short flags) -
getVersion
public static byte getVersion(int packetHeader) -
getOpCode
public static byte getOpCode(int packetHeader) -
getFlags
public static short getFlags(int packetHeader)
-