FileDocCategorySizeDatePackage
ArchivistUtils.javaAPI DocGlassfish v2 API3155Fri May 04 22:32:18 BST 2007com.sun.enterprise.util.shared

ArchivistUtils

public class ArchivistUtils extends Object
This class contains utility methods that handles the archives.
author
Deployment Dev Team
version

Fields Summary
Constructors Summary
Methods Summary
public static voidcopy(java.io.InputStream is, java.io.OutputStream os)
Utility method that eads the input stream fully and writes the bytes to the current entry in the output stream.

        copyWithoutClose(is, os);
        is.close();
        os.close();
    
public static voidcopyWithoutClose(java.io.InputStream is, java.io.OutputStream os)
Utility method that eads the input stream fully and writes the bytes to the current entry in the output stream.

        byte[] buf = new byte[4096];
        int len = 0;
        while (len != -1) {
            try {
                len = is.read(buf, 0, buf.length);
            } catch (EOFException eof){
                break;
            }

            if(len != -1) {
                os.write(buf, 0, len);
            }
        }
        os.flush();