import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;


public class Main {

	private static byte[] TIMECODE_SEQ_HEADER = {
		0x54, 0x69, 0x6D, 0x65, 0x63, 0x6F, 0x64, 0x65, 0x53, 0x65, 0x71, 0x75, 0x65, 0x6E, 0x63, 0x65,
		0x73, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
	};
	
	
	public static void main(String[] args) throws IOException {
		File fin = new File("TestProjekt.TrackList");
		File fout = new File("TestProjekt.TimecodeSequences");
		
		if (!fin.exists()) {
			System.err.println("Input file does not exist");
			System.exit(1);
		}

		FileInputStream fstream = new FileInputStream(fin);
		FileOutputStream foutstream = new FileOutputStream(fout);
		
		// Read header
		byte[] buffer = new byte[1024];
		fstream.read(buffer, 0, 24);
		
		foutstream.write(TIMECODE_SEQ_HEADER);
		int readbytes = 0;
		
		while ( (readbytes = fstream.read(buffer)) > 0) {
			foutstream.write(buffer, 0, readbytes);
		}
		
		fstream.close();
		foutstream.close();
		
	}

}
