/*
* reserved comment block
* DO NOT REMOVE OR ALTER!
*/
/*
* Copyright 1999-2005 The Apache Software Foundation.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
/*
*/
/*
* $Id: DigesterOutputStream.java,v 1.2 2008/07/24 15:20:31 mullan Exp $
*/
/**
* This class has been modified slightly to use java.security.MessageDigest
* objects as input, rather than
* com.sun.org.apache.xml.internal.security.algorithms.MessageDigestAlgorithm objects.
* It also optionally caches the input bytes.
*
* @author raul
* @author Sean Mullan
*/
private boolean buffer = false;
/**
* Creates a DigesterOutputStream.
*
* @param md the MessageDigest
*/
this(md, false);
}
/**
* Creates a DigesterOutputStream.
*
* @param md the MessageDigest
* @param buffer if true, caches the input bytes
*/
if (buffer) {
bos = new UnsyncByteArrayOutputStream();
}
}
/** @inheritDoc */
}
/** @inheritDoc */
if (buffer) {
}
}
/** @inheritDoc */
if (buffer) {
}
}
}
}
/**
* @return the digest value
*/
public byte[] getDigestValue() {
}
/**
* @return an input stream containing the cached bytes, or
* null if not cached
*/
if (buffer) {
} else {
return null;
}
}
}