class SPPEncoder implements MALEncoder, MALListEncoder {

	@Override
	public void encodeDuration(final Duration att) throws IllegalArgumentException, MALException {
		if (att == null) {
			throw new IllegalArgumentException(ILLEGAL_NULL_ARGUMENT);
		}
		AbsoluteDate epoch = CCSDSTime.createEpoch(Configuration.DURATION_EPOCH, Configuration.DURATION_EPOCH_TIMESCALE);
		// PENDING: Error in MAL Java API Magenta Book, Duration should contain fractional seconds,
		// but contains integer seconds. There is nothing we can do except to wait for an updated
		// book and implementation.
//		long ct = att.getValue();
		double ct = att.getValue();
		CCSDSTime tf = getDurationFormatter();
		if (tf.getTimeCode() != CCSDSTime.TimeCode.CUC) {
			throw new MALException(WRONG_TIME_FORMAT);
		}
		// Split into coarseTime and fineTime in order to minimize rounding errors.
		AbsoluteDate coarseTime = new AbsoluteDate(epoch, ct);
		AbsoluteDate fineTime = coarseTime.shiftedBy(0);
		byte[] tField = tf.getEncodedTime(coarseTime, fineTime, true);
		write(tField);
	}

	public  SPPEncoder(final OutputStream outputStream, final Map properties);

}