Section 3.1.7.1 ExtendedBuffer
        /// <summary>
        /// Extracts the payloads contained in the response buffer.
        /// </summary>
        /// <param name="response">The rgbOut or rgbAuxOut buffer returned from server.</param>
        /// <returns>The payloads array that was extracted from the response buffer.</returns>
        private static ExtendedBuffer[] ExtractExtendedBuffer(byte[] response)
        {
            if (response == null)
            {
                return null;
            }

            if (response.Length == 0)
            {
                return null;
            }

            bool errorBuffer = false;
            for (int i = 0; i < response.Length; i++)
            {
                if (response[i] != 0)
                {
                    errorBuffer = true;
                }
            }

            if (!errorBuffer)
            {
                return null;
            }

            int pos = 0;
            int index = 0;

            ExtendedBuffer[] buffer = new ExtendedBuffer[ConstValues.ArbitraryInitialSizeForBuffer];
            while (pos + AdapterHelper.RPCHeaderExtlength < response.Length + 1)
            {
                byte[] hdr_Bytes = new byte[AdapterHelper.RPCHeaderExtlength];
                System.Array.Copy(response, pos, hdr_Bytes, 0, hdr_Bytes.Length);

                RPC_HEADER_EXT hdr;
                if (!ExtractExtendedHeader(hdr_Bytes, out hdr))
                {
                    break;
                }
                else if (pos + AdapterHelper.RPCHeaderExtlength + hdr.SizeActual > response.Length)
                {
                    break;
                }
                else
                {
                    buffer[index].Header = hdr;
                    buffer[index].Payload = new byte[hdr.SizeActual];
                    System.Array.Copy(response, pos + AdapterHelper.RPCHeaderExtlength, buffer[index].Payload, 0, hdr.SizeActual);
                    index++;
                    pos += AdapterHelper.RPCHeaderExtlength + hdr.SizeActual;
                }
            }

            System.Array.Resize<ExtendedBuffer>(ref buffer, index);
            return buffer;
        }