public static OutputStream createOutputStream()

in src/java/org/apache/fulcrum/jce/crypto/StreamUtil.java [113:140]


    public static OutputStream createOutputStream( Object target )
        throws IOException
    {
        OutputStream os;

        if( target instanceof File )
        {
            File currFile = (File) target;
            createParentFile(currFile);
            os = new FileOutputStream(currFile);
        }
        else if( target instanceof String )
        {
            File currFile = new File((String) target);
            createParentFile(currFile);
            os = new FileOutputStream(currFile);
        }
        else if( target instanceof OutputStream )
        {
            os = (OutputStream) target;
        }
        else
        {
            throw new IllegalArgumentException("Don't know hot to handle " + target.getClass().getName());
        }

        return os;
    }