/** * Decodes second bit of Payload Type. * * @param payloadType * @return True if payload is authenticated, false otherwise. */ public boolean decodeAuthentication(byte payloadType) { return !((payloadType & TypeConverter.intToByte(0x40)) == 0); }
public static PayloadType decodePayloadType(byte payloadType) throws IllegalArgumentException { return PayloadType.parseInt( TypeConverter.intToByte(payloadType & TypeConverter.intToByte(0x3f))); }
/** * Decodes first bit of Payload Type. * * @param payloadType * @return True if payload is encrypted, false otherwise. */ private boolean decodeEncryption(byte payloadType) { return !((payloadType & TypeConverter.intToByte(0x80)) == 0); }