---
title: "xpc_data_get_length(_:)"
framework: xpc
role: symbol
role_heading: Function
path: "xpc/xpc_data_get_length(_:)"
---

# xpc_data_get_length(_:)

Returns the length of the data that an XPC data object encapsulates.

## Declaration

```swift
func xpc_data_get_length(_ xdata: xpc_object_t) -> Int
```

## Parameters

- `xdata`: The data object which is to be examined.

## Return Value

Return Value The length of the underlying boxed data.

## See Also

### Data objects

- [xpc_data_create(_:_:)](xpc/xpc_data_create(_:_:).md)
- [xpc_data_create_with_dispatch_data(_:)](xpc/xpc_data_create_with_dispatch_data(_:).md)
- [xpc_data_get_bytes(_:_:_:_:)](xpc/xpc_data_get_bytes(_:_:_:_:).md)
- [xpc_data_get_bytes_ptr(_:)](xpc/xpc_data_get_bytes_ptr(_:).md)
