public Format run( ReadableChannelWrapper in) throws IOException {
		Format format = new Format();
        	Key< Integer> headerStartKey = in.start();
		
		Key< Integer> lead = in.start();
		format.getLead().read( in);
		log( "Lead ended at '" + in.finish( lead) + "'.");

		Key< Integer> signature = in.start();
		int count = format.getSignature().read( in);
		Entry<?> sigEntry = format.getSignature().getEntry(SIGNATURES);
		int expected = sigEntry == null ? 0:  ByteBuffer.wrap(( byte[]) sigEntry.getValues(), 8, 4).getInt() / -16;
		log( "Signature ended at '" + in.finish( signature) + "' and contained '" + count + "' headers (expected '" + expected + "').");

        	Integer headerStartPos = in.finish(headerStartKey);
        	format.getHeader().setStartPos(headerStartPos);
		Key< Integer> headerKey = in.start();
		count = format.getHeader().read( in);
		Entry<?> immutableEntry = format.getHeader().getEntry( HEADERIMMUTABLE);
		expected = immutableEntry == null ? 0 : ByteBuffer.wrap(( byte[]) immutableEntry.getValues(), 8, 4).getInt() / -16;
        	Integer headerLength = in.finish(headerKey);
        	format.getHeader().setEndPos(headerStartPos + headerLength);
        	log( "Header ended at '" + headerLength + " and contained '" + count + "' headers (expected '" + expected + "').");

		return format;
	}
public Format run ( ReadableChannelWrapper in ) throws IOException { Format format = new Format ( ) ; Key < Integer > headerStartKey = in . start ( ) ; Key < Integer > lead = in . start ( ) ; format . getLead ( ) . read ( in ) ; log ( "Lead ended at '" + in . finish ( lead ) + "'." ) ; Key < Integer > signature = in . start ( ) ; int count = format . getSignature ( ) . read ( in ) ; Entry < ? > sigEntry = format . getSignature ( ) . getEntry ( SIGNATURES ) ; int expected = sigEntry == null ? 0 : ByteBuffer . wrap ( ( byte [ ] ) sigEntry . getValues ( ) , 8 , 4 ) . getInt ( ) / - 16 ; log ( "Signature ended at '" + in . finish ( signature ) + "' and contained '" + count + "' headers (expected '" + expected + "')." ) ; Integer headerStartPos = in . finish ( headerStartKey ) ; format . getHeader ( ) . setStartPos ( headerStartPos ) ; Key < Integer > headerKey = in . start ( ) ; count = format . getHeader ( ) . read ( in ) ; Entry < ? > immutableEntry = format . getHeader ( ) . getEntry ( HEADERIMMUTABLE ) ; expected = immutableEntry == null ? 0 : ByteBuffer . wrap ( ( byte [ ] ) immutableEntry . getValues ( ) , 8 , 4 ) . getInt ( ) / - 16 ; Integer headerLength = in . finish ( headerKey ) ; format . getHeader ( ) . setEndPos ( headerStartPos + headerLength ) ; log ( "Header ended at '" + headerLength + " and contained '" + count + "' headers (expected '" + expected + "')." ) ; return format ; }
Reads the headers of an RPM and returns a description of it
and it's format.

@param in the channel wrapper to read input from
@return information describing the RPM file
@throws IOException if an error occurs reading the file