Class BookieProtocol.PacketHeader

  • Enclosing interface:
    BookieProtocol

    public static final class BookieProtocol.PacketHeader
    extends java.lang.Object
    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 
      Constructor Description
      PacketHeader()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static short getFlags​(int packetHeader)  
      static byte getOpCode​(int packetHeader)  
      static byte getVersion​(int packetHeader)  
      static int toInt​(byte version, byte opCode, short flags)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • PacketHeader

        public PacketHeader()
    • Method Detail

      • 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)