immutable.setValues( getImmutable( format.getHeader().count()));
	public void build( final FileChannel original) throws Exception {		format.getHeader().createEntry( DIRNAMES, dirnames.toArray( new String[ dirnames.size()]));		format.getHeader().createEntry( BASENAMES, filenames.toArray( new String[ filenames.size()]));		final WritableChannelWrapper uncompressed = new WritableChannelWrapper( original);		/*		final Map< PrivateKey, Entry< byte[]>> map = new HashMap< PrivateKey, Entry< byte[]>>();		for ( PrivateKey key : signatures) {			if ( "MD5withRSA".equals( key.getAlgorithm())) map.put( key, ( Entry< byte[]>) format.getSignature().addEntry( GPG, GPGSIZE));			else if ( "SHA1withDSA".equals( key.getAlgorithm())) map.put( key, ( Entry< byte[]>) format.getSignature().addEntry( DSAHEADER, DSASIZE));			else throw new IOException( "Unknown key type '" + key.getAlgorithm() + "'.");		}		*/		// Since the RPM wants the MD5s to be signed to we have to run through each file first.  Yech.		final String[] md5s = new String[ filenames.size()];		int count = 0;		for ( String path : files.keySet()) {			final File file = files.get( path);			final ReadableChannelWrapper input = new ReadableChannelWrapper( new FileInputStream( file).getChannel());			final Key< byte[]> key = input.start( "MD5");			ByteBuffer buffer = ByteBuffer.allocate( 1024);			while ( input.read( buffer) != -1) buffer.rewind();			md5s[ count++] = hex( input.finish( key));			input.close();		}		format.getHeader().createEntry( FILEMD5S, md5s);		final Entry< int[]> sigsize = ( Entry< int[]>) format.getSignature().addEntry( LEGACY_SIGSIZE, 1);		final Entry< int[]> payload = ( Entry< int[]>) format.getSignature().addEntry( PAYLOADSIZE, 1);		final Entry< byte[]> md5 = ( Entry< byte[]>) format.getSignature().addEntry( LEGACY_MD5, 16);		final Entry< String[]> sha = ( Entry< String[]>) format.getSignature().addEntry( SHA1HEADER, 1);		sha.setSize( SHASIZE);		format.getLead().write( original);		format.getSignature().write( original);		Key< Integer> sigsizekey = uncompressed.start();		/*		for ( PrivateKey key : map.keySet()) {			final Entry< byte[]> entry = map.get( key);			final WritableByteChannel encrypted = new EncryptionChannel( channel) {				public void sign( final byte[] signature) { entry.setValues( signature); }			};		}		*/				Key< byte[]> shakey = uncompressed.start( "SHA");		Key< byte[]> md5key = uncompressed.start( "MD5");		format.getHeader().write( uncompressed);		sha.setValues( new String[] { hex( uncompressed.finish( shakey))});		final GZIPOutputStream zip = new GZIPOutputStream( Channels.newOutputStream( uncompressed));		final WritableChannelWrapper compressed = new WritableChannelWrapper( Channels.newChannel( zip));		Key< Integer> payloadkey = compressed.start();				final ByteBuffer buffer = ByteBuffer.allocate( 4096);		for ( String path : files.keySet()) {			final File file = files.get( path);			final CpioHeader header = new CpioHeader( file);			header.setName( path);			header.write( compressed);						FileChannel in = new FileInputStream( file).getChannel();			while ( in.read( buffer) != -1) {				buffer.flip();				while ( buffer.hasRemaining()) compressed.write( buffer);				buffer.clear();			}			Util.empty( compressed, ByteBuffer.wrap( new byte[ Util.round( header.getFileSize(), 3) - ( int) file.length()]));			in.close();		}				final CpioHeader trailer = new CpioHeader();		trailer.setLast();		trailer.write( compressed);		Util.empty( compressed, ByteBuffer.wrap( new byte[] { 0, 0}));		payload.setValues( new int[] { compressed.finish( payloadkey)});		zip.finish();				md5.setValues( uncompressed.finish( md5key));		sigsize.setValues( new int[] { uncompressed.finish( sigsizekey)});		format.getSignature().writePending( original);		uncompressed.close();	}