Instance Method

advanced(by:)

Returns a new data buffer created by removing the given number of bytes from the front of the original buffer.

Declaration

func advanced(by amount: Int) -> Data

Parameters

amount

The number of bytes to strip from the input data buffer. The value must be less than the original data buffer's length.

Return Value

A newly created data buffer that is shorter by the given amount than the original.

See Also

Excluding Bytes

func dropLast(Int) -> Data

Returns a subsequence containing all but the specified number of final elements.

func dropFirst(Int) -> Data

Returns a subsequence containing all but the given number of initial elements.

func drop(while: (UInt8) -> Bool) -> Data

Returns a subsequence by skipping elements while predicate returns true and returning the remaining elements.