Code: Select all
SFSDataWrapper* DefaultSFSDataSerializer::BinDecode_BYTE_ARRAY(ByteArray* buffer)
{
long int size;
buffer->ReadInt(size);
if (size < 0)
{
string* err = new string();
string* format = new string("Array negative size: %d");
StringFormatter<long int> (err, format, size);
delete format;
format = NULL;
boost::shared_ptr<SFSCodecError> exception(new SFSCodecError(err));
throw exception;
}
// copy bytes
vector<unsigned char> values;
buffer->ReadBytes(size, values);
ByteArray* arrayobj = new ByteArray(&values);
return new SFSDataWrapper(SFSDATATYPE_BYTE_ARRAY, arrayobj);
}
modify
Code: Select all
........
//ByteArray* arrayobj = new ByteArray(&values);
//modify bqlf1907
ByteArray* arrayobj = new ByteArray();
arrayobj->WriteBytes(&values);
.......