com.bea.content
Class BinaryHelper

java.lang.Object
  extended by com.bea.content.BinaryHelper

public class BinaryHelper
extends Object

A helper class for dealing with binary data. This class is used to compute the checksum value stored in the WLP Repository.


Constructor Summary
BinaryHelper()
           
 
Method Summary
static String createChecksum(InputStream is)
          Creates a checksum for a given InputStream.
static String getChecksum(MessageDigest digest)
          Takes a populated MessageDigest and returns the HEX representation of the CheckSum.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BinaryHelper

public BinaryHelper()
Method Detail

createChecksum

public static String createChecksum(InputStream is)
                             throws RepositoryException
Creates a checksum for a given InputStream. The checksum is generated using a MessageDigest with the MD5 algorithm. Note: This method will consume the InputStream.

Parameters
is - a non-null InputStream
Returns
a String containing the checksum
Throws
RepositoryException - if an error occurs during the computation.

getChecksum

public static String getChecksum(MessageDigest digest)
Takes a populated MessageDigest and returns the HEX representation of the CheckSum.

Parameters
digest - The digest.
Returns
The checksum.


Copyright © 2011, Oracle. All rights reserved.