public byte[] ToByteArray() { byte[] newRecordBytes = new byte[m_expectedRecordLength]; int length = new ServiceRecordCreator().CreateServiceRecord(m_record, newRecordBytes); System.Diagnostics.Debug.Assert(length == m_expectedRecordLength); //old for (int i = 0; i < m_data.Length; ++i) { if (m_data[i] != newRecordBytes[i]) { System.Diagnostics.Debug.Fail(String.Format( "Internal error--Records different at index {0} was 0x{1} is 0x{2}.", i, m_data[i], newRecordBytes[i])); } }//for return(newRecordBytes); }
public byte[] ToByteArray() { byte[] newRecordBytes = new byte[m_expectedRecordLength]; int length = new ServiceRecordCreator().CreateServiceRecord(m_record, newRecordBytes); System.Diagnostics.Debug.Assert(length == m_expectedRecordLength); //old for (int i = 0; i < m_data.Length; ++i) { if (m_data[i] != newRecordBytes[i]) { System.Diagnostics.Debug.Fail(String.Format( "Internal error--Records different at index {0} was 0x{1} is 0x{2}.", i, m_data[i], newRecordBytes[i])); } }//for return newRecordBytes; }
/// <summary> /// Return the byte array representing the service record. /// </summary> /// - /// <remarks>The byte array content is created dynamically from the /// <see cref="T:InTheHand.Net.Bluetooth.ServiceRecord"/> instance using /// the <see cref="T:InTheHand.Net.Bluetooth.ServiceRecordCreator"/> class. /// </remarks> public byte[] ToByteArray() { byte[] createdFromParsedRecord = new ServiceRecordCreator().CreateServiceRecord(this); VerifyParsedCreatedEqualsSourceIf(createdFromParsedRecord); return createdFromParsedRecord; }
/// <summary> /// Return the byte array representing the service record. /// </summary> /// - /// <remarks>The byte array content is created dynamically from the /// <see cref="T:InTheHand.Net.Bluetooth.ServiceRecord"/> instance using /// the <see cref="T:InTheHand.Net.Bluetooth.ServiceRecordCreator"/> class. /// </remarks> /// - /// <returns>The result as an array of <see cref="T:System.Byte"/>. /// </returns> /// - /// <seealso cref="SourceBytes"/> public byte[] ToByteArray() { byte[] createdFromParsedRecord = new ServiceRecordCreator().CreateServiceRecord(this); return(createdFromParsedRecord); }