private static String byteArrayToUNCString(byte[] data,
                                              int nStartPos,
                                              int nNumOfBytes)
    {
        // we need two bytes for every character
        nNumOfBytes &= ~1;

        // enough bytes in the buffer?
        int nAvailCapacity = data.length - nStartPos;

        if (nAvailCapacity < nNumOfBytes)
        {
            nNumOfBytes = nAvailCapacity;
        }

        StringBuilder sbuf = new StringBuilder();
        sbuf.setLength(nNumOfBytes >> 1);

        int nSBufPos = 0;

        while (nNumOfBytes > 0)
        {
            sbuf.setCharAt(nSBufPos++,
                    (char)(((int)data[nStartPos] << 8) | ((int)data[nStartPos + 1] & 0x0ff)));
            nStartPos += 2;
            nNumOfBytes -= 2;
        }

        return sbuf.toString();
    }
converts a byte array into an UNICODE string
@param data the byte array
@param nStartPos where to begin the conversion
@param nNumOfBytes number of bytes to handle
@return the string
xmppserver/src/main/java/org/jivesoftware/util/Blowfish.java