src/java/fr/jayasoft/ivy/xml/XmlModuleDescriptorUpdater.java
/**
     * Copy xml header from src url ivy file to given printwriter
     * In fact, copies everything before <ivy-module to out, except
     * if <ivy-module is not found, in which case nothing is copied.
     * 
     * @param in
     * @param out
     * @throws IOException
     */
Copy xml header from src url ivy file to given printwriter
In fact, copies everything before <ivy-module to out, except
if <ivy-module is not found, in which case nothing is copied.

@param in
@param out
@throws IOException
Copy xml header from src url ivy file to given printwriter In fact copies everything before <ivy - module to out except if <ivy - module is not found in which case nothing is copied . @param in @param out @throws IOException
private static void copyHeader(InputStream in, PrintWriter out) throws IOException {
        StringBuffer buf = new StringBuffer();
        BufferedReader r = new BufferedReader(new InputStreamReader(in));
        for (String line = r.readLine(); line != null; line = r.readLine()) {
            int index = line.indexOf("<ivy-module");
            if (index == -1) {
                buf.append(line).append(LINE_SEPARATOR);
            } else {
                buf.append(line.substring(0, index));
                out.print(buf.toString());
                break;
            }
        }
    }
private static void copyHeader ( InputStream in , PrintWriter out ) throws IOException { StringBuffer buf = new StringBuffer ( ) ; BufferedReader r = new BufferedReader ( new InputStreamReader ( in ) ) ; for ( String line = r . readLine ( ) ; line != null ; line = r . readLine ( ) ) { int index = line . indexOf ( "<ivy-module" ) ; if ( index == - 1 ) { buf . append ( line ) . append ( LINE_SEPARATOR ) ; } else { buf . append ( line . substring ( 0 , index ) ) ; out . print ( buf . toString ( ) ) ; break ; } } }
Copy xml header from src url ivy file to given printwriter
 In fact, copies everything before <ivy-module to out, except
 if <ivy-module is not found, in which case nothing is copied.
Copy xml header from src url ivy file to given printwriter In fact copies everything before <ivy - module to out except if <ivy - module is not found in which case nothing is copied .
//r.close();
