@Test public void testserializeConfidentialDataNullOptionSet() { exception.expect(NullPointerException.class); OSSerializer.serializeConfidentialData(null, payload, realCode); }
public static byte[] serializeConfidentialData(OptionSet options, byte[] payload, int realCode) { if (options != null) { DatagramWriter writer = new DatagramWriter(); if (realCode > 0) { OptionSet filteredOptions = OptionJuggle.prepareEoptions(options); writer.write(realCode, CoAP.MessageFormat.CODE_BITS); DataSerializer.serializeOptionsAndPayload(writer, filteredOptions, payload); return writer.toByteArray(); } else { LOGGER.error(ErrorDescriptions.COAP_CODE_INVALID); throw new IllegalArgumentException(ErrorDescriptions.COAP_CODE_INVALID); } } else { LOGGER.error(ErrorDescriptions.OPTIONSET_NULL); throw new NullPointerException(ErrorDescriptions.OPTIONSET_NULL); } }
OSSerializer { public static byte[] serializeConfidentialData(OptionSet options, byte[] payload, int realCode) { if (options != null) { DatagramWriter writer = new DatagramWriter(); if (realCode > 0) { OptionSet filteredOptions = OptionJuggle.prepareEoptions(options); writer.write(realCode, CoAP.MessageFormat.CODE_BITS); DataSerializer.serializeOptionsAndPayload(writer, filteredOptions, payload); return writer.toByteArray(); } else { LOGGER.error(ErrorDescriptions.COAP_CODE_INVALID); throw new IllegalArgumentException(ErrorDescriptions.COAP_CODE_INVALID); } } else { LOGGER.error(ErrorDescriptions.OPTIONSET_NULL); throw new NullPointerException(ErrorDescriptions.OPTIONSET_NULL); } } }
OSSerializer { public static byte[] serializeConfidentialData(OptionSet options, byte[] payload, int realCode) { if (options != null) { DatagramWriter writer = new DatagramWriter(); if (realCode > 0) { OptionSet filteredOptions = OptionJuggle.prepareEoptions(options); writer.write(realCode, CoAP.MessageFormat.CODE_BITS); DataSerializer.serializeOptionsAndPayload(writer, filteredOptions, payload); return writer.toByteArray(); } else { LOGGER.error(ErrorDescriptions.COAP_CODE_INVALID); throw new IllegalArgumentException(ErrorDescriptions.COAP_CODE_INVALID); } } else { LOGGER.error(ErrorDescriptions.OPTIONSET_NULL); throw new NullPointerException(ErrorDescriptions.OPTIONSET_NULL); } }  }
OSSerializer { public static byte[] serializeConfidentialData(OptionSet options, byte[] payload, int realCode) { if (options != null) { DatagramWriter writer = new DatagramWriter(); if (realCode > 0) { OptionSet filteredOptions = OptionJuggle.prepareEoptions(options); writer.write(realCode, CoAP.MessageFormat.CODE_BITS); DataSerializer.serializeOptionsAndPayload(writer, filteredOptions, payload); return writer.toByteArray(); } else { LOGGER.error(ErrorDescriptions.COAP_CODE_INVALID); throw new IllegalArgumentException(ErrorDescriptions.COAP_CODE_INVALID); } } else { LOGGER.error(ErrorDescriptions.OPTIONSET_NULL); throw new NullPointerException(ErrorDescriptions.OPTIONSET_NULL); } }  static byte[] serializeConfidentialData(OptionSet options, byte[] payload, int realCode); static byte[] serializeAAD(int version, AlgorithmID algorithm, int requestSeq, byte[] requestSenderId, OptionSet options); static byte[] nonceGeneration(byte[] partialIV, byte[] senderID, byte[] commonIV, int nonceLength); static byte[] leftPaddingZeroes(byte[] paddMe, int zeros); static byte[] processPartialIV(int value); static byte[] stripZeroes(byte[] in); }
OSSerializer { public static byte[] serializeConfidentialData(OptionSet options, byte[] payload, int realCode) { if (options != null) { DatagramWriter writer = new DatagramWriter(); if (realCode > 0) { OptionSet filteredOptions = OptionJuggle.prepareEoptions(options); writer.write(realCode, CoAP.MessageFormat.CODE_BITS); DataSerializer.serializeOptionsAndPayload(writer, filteredOptions, payload); return writer.toByteArray(); } else { LOGGER.error(ErrorDescriptions.COAP_CODE_INVALID); throw new IllegalArgumentException(ErrorDescriptions.COAP_CODE_INVALID); } } else { LOGGER.error(ErrorDescriptions.OPTIONSET_NULL); throw new NullPointerException(ErrorDescriptions.OPTIONSET_NULL); } }  static byte[] serializeConfidentialData(OptionSet options, byte[] payload, int realCode); static byte[] serializeAAD(int version, AlgorithmID algorithm, int requestSeq, byte[] requestSenderId, OptionSet options); static byte[] nonceGeneration(byte[] partialIV, byte[] senderID, byte[] commonIV, int nonceLength); static byte[] leftPaddingZeroes(byte[] paddMe, int zeros); static byte[] processPartialIV(int value); static byte[] stripZeroes(byte[] in);  }