Instance Method

isEqual(to:)

Returns a Boolean indicating whether this data object is the same as another.

Declaration

func isEqual(to other: Data) -> Bool

Parameters

otherData

The data object with which to compare the receiver.

Return Value

true if the contents of otherData are equal to the contents of the receiver, otherwise false.

Discussion

Two data objects are equal if they hold the same number of bytes, and if the bytes at the same position in the objects are the same.

See Also

Testing Data

var length: Int

The number of bytes contained by the data object.

func contains(UInt8)

Returns a Boolean value indicating whether the sequence contains the given element.

func contains(where: (UInt8) -> Bool)

Returns a Boolean value indicating whether the sequence contains an element that satisfies the given predicate.