
package turgen.generator;

/** Electric signal writer
 * 
 * @author michael
 */
public interface SignalWriter {
   
    /** Prepare signal writer
     * 
     * @param outputFile Output file
     * @return Error message or null when preparation is OK
     */
    public String prepare(String outputFile);
    
    
    /** Write initial signal
     * 
     * @param signal Signal
     * @throws Exception 
     */
    public void writeInitialSignal(byte[] signal) throws Exception;
    
    /** Write termination signal
     * 
     * @param signal Signal
     * @throws Exception 
     */
    public void writeTerminationSignal(byte[] signal) throws Exception;
    
    /** Write data
     * 
     * @param signal
     * @throws Exception 
     */
    public void write(byte[] signal) throws Exception;
    
    /** Prepare for closing
     * 
     * @throws Exception 
     */
    public void prepareForClose() throws Exception;
    
    /** Close writer
     * 
     * @throws Exception 
     */
    public void close() throws Exception;
    
    /** Flush data instantly
     * @throws java.lang.Exception
     */
    public void flush() throws Exception;
    
}
