この関数でstring
は、引数として渡します(これは、文字列として膨大な量のデータを持っています)...
SendBytes メソッドは次のように定義されています
bool NetOutputBuffer_c::SendBytes ( const void * pBuf, int iLen )
{
BYTE * pMy = (BYTE*)pBuf;
while ( iLen>0 && !m_bError )
{
int iLeft = m_iBufferSize - ( m_pBufferPtr-m_pBuffer );
if ( iLen<=iLeft )
{
printf("iLen is %d\n",iLen);
memcpy ( m_pBufferPtr, pMy, iLen );
m_pBufferPtr += iLen;
break;
}
ResizeIf ( iLen );
}
return !m_bError;
}
bool NetOutputBuffer_c::SendCompressedString ( std::string sStr )
{
std::cout << sStr << endl;
const char *cStr = sStr.c_str();
std::cout << cStr <<endl;
int iLen = cStr ? strlen(cStr) : 0;
SendInt ( iLen );
return SendBytes ( cStr, iLen );
}
sStr の値を出力して、適切なデータがあるかどうかを確認してみました。
次に、をに変換std::string
しますconst char *
変換後、cStrの値を出力してみました。しかし、実際には it(cStr) には実際のデータ (sStr) の 5% が含まれています...
データ全体を取得するにはどうすればよいですか?
この点で誰かが私を導くことができますか?