public static void writeSat(ChannelList channelList, File outputFile) {
		OutputStream outStream;
		try {
			outStream = new FileOutputStream(outputFile);
		} catch (FileNotFoundException e) {
			System.out.println("Cannot write to file:\n" + e.getMessage());
			return;
		}

		/* build byte array to write out */
		int entries = 0;
		int recordLen = 0;
		Channel satChannel;
		char fileVersion = channelList.getListVersion();
		switch (fileVersion) {
			case 'B': {
				recordLen = SatChannelB.lChan;
				break;
			}
			case 'C': {
				recordLen = SatChannelC.lChan;
				break;
			}
			case 'D': {
				recordLen = SatChannelD.lChan;
				break;
			}
			default: // Error
				System.out.println("Function not implemented for " + fileVersion + "-Series TV");
				try { outStream.close(); } catch(IOException e) {}
				return;
		}
		for(int i = 0; i < channelList.size(); i++) {
			satChannel = (SatChannel) channelList.get(i);

			byte[] rawData = satChannel.writeByteArray();

			try {
				outStream.write(rawData, 0, recordLen);
			} catch (IOException e) {
				e.printStackTrace();
				try { outStream.close(); } catch(IOException e1) {}
				return;
			}
			entries++;
		}
		
		try { outStream.close(); } catch (IOException e) {}

		/* fill with null bytes until we reach a multiple of 1000 entries */
		/*
		 * it is not necessary anymore to fill up to 1000 entries!
		 * 
		 * while(entries % 1000 != 0) { chan = new SatChannelC(); byte[] rawData
		 * = new byte[SatChannel.initLen]; try { // outStream.write(rawData);
		 * outStream.write(rawData, 0, chan.recordLen); } catch (IOException e)
		 * { e.printStackTrace(); return; } entries++; }
		 */
		/* write the file out */
		System.out.println("Channel list written to file: " + outputFile.getAbsolutePath());
		return;
	}