public static byte[] createChecksum(String filename) throws FileNotFoundException
    {
        InputStream fis =  new FileInputStream(filename);
        try
        {
            byte[] buffer = new byte[1024];
            MessageDigest complete = MessageDigest.getInstance("MD5"); 
            int numRead;
            do 
            {
                numRead = fis.read(buffer);
                if (numRead > 0) 
                {
                    complete.update(buffer, 0, numRead);
                }
            } while (numRead != -1);
            return complete.digest();
        } catch (IOException ex) {
            Logger.getLogger(Checksum.class.getName()).log(Level.SEVERE, null, ex);
        }
        catch (NoSuchAlgorithmException ex) {
            Logger.getLogger(Checksum.class.getName()).log(Level.SEVERE, null, ex);
        }        
        finally
        {
            try {
                fis.close();
            } catch (IOException ex) {
                Logger.getLogger(Checksum.class.getName()).log(Level.SEVERE, null, ex);
            }
        }
        
        return null;
    }