/**
 * @author	STF 424_ITS_Test_Platform
 * @version    $URL$
 *             $Id$
 */
package org.etsi.its.codec.adapter;

import java.io.IOException;

import org.etsi.its.codec.IEnumConverter;

/** 
 * This interface provides mandatory methods to implements Test Adapter codec
 */
public interface ICodec {

	/**
	 * Encode the specified type/value into a TLV sequence
	 * 
	 * @param type The type to encode
	 * @param buffer The value for this type
	 * @param timestamp  Reception time
	 * @return A TLV sequence in byte format
	 * @throws IOException Signals that an I/O exception of some sort has occurred
	 */
	public byte[] Encode(final IEnumConverter type, final byte[] buffer, final long timestamp) throws IOException;

	/**
	 * Decodes the specified message
	 * 
	 * @param message The message to decode in bytes format
	 * @return A list of TLV sequences
	 */
	public IValue Decode(final byte[] message);
}
