/*
 * Class:     jp_co_omron_hvcw_HvcwApi
 * Method:    albumGetUserName
 * Signature: (JILjava/lang/StringBuffer;Ljp/co/omron/hvcw/Int;)I
 */
JNIEXPORT jint JNICALL Java_jp_co_omron_hvcw_HvcwApi_albumGetUserName
(JNIEnv *env, jobject obj, jlong handle, jint nUserID, jobject objName, jobject returnStatus)
{
	HVCW_INT32 nRet;
	HVCW_INT32 nReturnStatus;
	HVCW_CHAR acName[44];
	jclass jcstrbuf;
	jmethodID mid;
	jstring stName;

	if(returnStatus == NULL){
		return HVCW_INVALID_PARAM;
	}

	memset(acName, 0x00, 44); /* クリア */

	HHVC hHVC = (HHVC)((long)handle);

	nRet = HVCW_ALBUM_GetUserName(hHVC, nUserID, acName, (HVCW_UINT8*)&nReturnStatus);
	__android_log_print(ANDROID_LOG_INFO, "Debug", "albumGetUserName 001 nRet:%d\n", nRet);
	__android_log_print(ANDROID_LOG_INFO, "Debug", "albumGetUserName 002 Name:%s\n", acName);
	if(HVCW_SUCCESS == nRet){
		nRet = JNUSetInt(env, returnStatus, (HVCW_UINT8)nReturnStatus);
	}

	ToStringBuffer(env, acName, objName);

	return nRet;
}
void CSocketAddress::ToString(std::string* pStr) const
{
    char sz[INET6_ADDRSTRLEN + 6];
    ToStringBuffer(sz, ARRAYSIZE(sz));
    *pStr = sz;
}