MCPcopy Create free account
hub / github.com/Kitware/ParaView / ParseArray

Method ParseArray

Remoting/ClientServerStream/vtkClientServerStream.cxx:1724–1751  ·  view source on GitHub ↗

----------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

1722
1723//----------------------------------------------------------------------------
1724unsigned char* vtkClientServerStream::ParseArray(
1725 int order, unsigned char* data, unsigned char* end, unsigned int wordSize)
1726{
1727 // Read the array length.
1728 vtkTypeUInt32 length;
1729 if (data > end - sizeof(length))
1730 {
1731 /* ERROR */
1732 return nullptr;
1733 }
1734 this->PerformByteSwap(order, data, 1, sizeof(length));
1735 memcpy(&length, data, sizeof(length));
1736 data += sizeof(length);
1737
1738 // Calculate the size of the array data.
1739 vtkTypeUInt32 size = length * wordSize;
1740
1741 // Byte-swap the array data.
1742 if (data > end - size)
1743 {
1744 /* ERROR */
1745 return nullptr;
1746 }
1747 this->PerformByteSwap(order, data, length, wordSize);
1748
1749 // Return the position after the array.
1750 return data + size;
1751}
1752
1753//----------------------------------------------------------------------------
1754unsigned char* vtkClientServerStream::ParseString(

Callers 2

ParseDataMethod · 0.95
ParseStreamMethod · 0.95

Calls 1

PerformByteSwapMethod · 0.95

Tested by

no test coverage detected