@Test public void testDecodeUnsigned8() throws UtilityException, DataTypeLengthMismatchException, UnknownHostException, MissingAbstractDataTypeException { byte[] data = IpfixUtilities.hexStringToByteArray("02"); int length = 1; IpfixDataRecordDecodeMethod method = new DecodeUnsigned8(); String value = method.decodeDataRecord(data, length); assertEquals("2", value); }
@Override public String decodeDataRecord(byte[] data, int length) throws UtilityException, DataTypeLengthMismatchException { if (length != LENGTH) { throw new DataTypeLengthMismatchException("Incorrect length for Unsigned8 type: " + length); } data = IpfixUtilities.copyByteArray(data, 0, LENGTH); return Integer.toString((IpfixUtilities.byteToInteger(data, 1, LENGTH))); }
DecodeUnsigned8 implements IpfixDataRecordDecodeMethod { @Override public String decodeDataRecord(byte[] data, int length) throws UtilityException, DataTypeLengthMismatchException { if (length != LENGTH) { throw new DataTypeLengthMismatchException("Incorrect length for Unsigned8 type: " + length); } data = IpfixUtilities.copyByteArray(data, 0, LENGTH); return Integer.toString((IpfixUtilities.byteToInteger(data, 1, LENGTH))); } }
DecodeUnsigned8 implements IpfixDataRecordDecodeMethod { @Override public String decodeDataRecord(byte[] data, int length) throws UtilityException, DataTypeLengthMismatchException { if (length != LENGTH) { throw new DataTypeLengthMismatchException("Incorrect length for Unsigned8 type: " + length); } data = IpfixUtilities.copyByteArray(data, 0, LENGTH); return Integer.toString((IpfixUtilities.byteToInteger(data, 1, LENGTH))); }  }
DecodeUnsigned8 implements IpfixDataRecordDecodeMethod { @Override public String decodeDataRecord(byte[] data, int length) throws UtilityException, DataTypeLengthMismatchException { if (length != LENGTH) { throw new DataTypeLengthMismatchException("Incorrect length for Unsigned8 type: " + length); } data = IpfixUtilities.copyByteArray(data, 0, LENGTH); return Integer.toString((IpfixUtilities.byteToInteger(data, 1, LENGTH))); }  @Override String decodeDataRecord(byte[] data, int length); }
DecodeUnsigned8 implements IpfixDataRecordDecodeMethod { @Override public String decodeDataRecord(byte[] data, int length) throws UtilityException, DataTypeLengthMismatchException { if (length != LENGTH) { throw new DataTypeLengthMismatchException("Incorrect length for Unsigned8 type: " + length); } data = IpfixUtilities.copyByteArray(data, 0, LENGTH); return Integer.toString((IpfixUtilities.byteToInteger(data, 1, LENGTH))); }  @Override String decodeDataRecord(byte[] data, int length);  }