private static String bytesToBinHex(byte[] data,
                                       int nStartPos,
                                       int nNumOfBytes)
    {
        StringBuilder sbuf = new StringBuilder();
        sbuf.setLength(nNumOfBytes << 1);

        int nPos = 0;
        for (int nI = 0; nI < nNumOfBytes; nI++)
        {
            sbuf.setCharAt(nPos++, HEXTAB[(data[nI + nStartPos] >> 4) & 0x0f]);
            sbuf.setCharAt(nPos++, HEXTAB[data[nI + nStartPos] & 0x0f]);
        }
        return sbuf.toString();
    }
converts a byte array to a binhex string
@param data the byte array
@param nStartPos start index where to get the bytes
@param nNumOfBytes number of bytes to convert
@return the binhex string
xmppserver/src/main/java/org/jivesoftware/util/Blowfish.java