Class PingFrame


  • public class PingFrame
    extends Frame
    • Field Detail

      • EMPTY_PAYLOAD

        private static final byte[] EMPTY_PAYLOAD
      • payload

        private final byte[] payload
      • reply

        private final boolean reply
    • Constructor Detail

      • PingFrame

        public PingFrame​(boolean reply)
        Creates a PING frame with an empty payload.
        Parameters:
        reply - whether this PING frame is a reply
      • PingFrame

        public PingFrame​(long value,
                         boolean reply)
        Creates a PING frame with the given long value as payload.
        Parameters:
        value - the value to use as a payload for this PING frame
        reply - whether this PING frame is a reply
      • PingFrame

        public PingFrame​(byte[] payload,
                         boolean reply)
        Creates a PING frame with the given payload.
        Parameters:
        payload - the payload for this PING frame
        reply - whether this PING frame is a reply
    • Method Detail

      • getPayload

        public byte[] getPayload()
      • getPayloadAsLong

        public long getPayloadAsLong()
      • isReply

        public boolean isReply()
      • toBytes

        private static byte[] toBytes​(long value)
      • toLong

        private static long toLong​(byte[] payload)