/// <summary> /// Parse the response data into response body. /// </summary> /// <param name="rawData">The raw data of response</param> /// <returns>The response body of unbind request</returns> public static UnbindResponseBody Parse(byte[] rawData) { UnbindResponseBody responseBody = new UnbindResponseBody(); int index = 0; responseBody.StatusCode = BitConverter.ToUInt32(rawData, index); index += 4; responseBody.ErrorCode = BitConverter.ToUInt32(rawData, index); index += 4; responseBody.AuxiliaryBufferSize = BitConverter.ToUInt32(rawData, index); index += 4; responseBody.AuxiliaryBuffer = new byte[responseBody.AuxiliaryBufferSize]; Array.Copy(rawData, index, responseBody.AuxiliaryBuffer, 0, responseBody.AuxiliaryBufferSize); return responseBody; }
/// <summary> /// Parse the response data into response body. /// </summary> /// <param name="rawData">The raw data of response</param> /// <returns>The response body of unbind request</returns> public static UnbindResponseBody Parse(byte[] rawData) { UnbindResponseBody responseBody = new UnbindResponseBody(); int index = 0; responseBody.StatusCode = BitConverter.ToUInt32(rawData, index); index += 4; responseBody.ErrorCode = BitConverter.ToUInt32(rawData, index); index += 4; responseBody.AuxiliaryBufferSize = BitConverter.ToUInt32(rawData, index); index += 4; responseBody.AuxiliaryBuffer = new byte[responseBody.AuxiliaryBufferSize]; Array.Copy(rawData, index, responseBody.AuxiliaryBuffer, 0, responseBody.AuxiliaryBufferSize); return(responseBody); }