<!--
{
  "availability" : [
    "iOS: 7.0.0 -",
    "iPadOS: 7.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.9.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "AVFoundation",
  "identifier" : "/documentation/AVFoundation/AVAssetResourceLoadingDataRequest/requestedLength",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Property",
  "symbol" : {
    "kind" : "Instance Property",
    "modules" : [
      "AVFoundation"
    ],
    "preciseIdentifier" : "c:objc(cs)AVAssetResourceLoadingDataRequest(py)requestedLength"
  },
  "title" : "requestedLength"
}
-->

# requestedLength

The length, in bytes, of the data requested.

```
var requestedLength: Int { get }
```

## Discussion

If the content length of the resource is unknown, the sum of the [`requestedLength`](/documentation/AVFoundation/AVAssetResourceLoadingDataRequest/requestedLength) and [`requestedOffset`](/documentation/AVFoundation/AVAssetResourceLoadingDataRequest/requestedOffset) properties may be greater than the actual content length. When this situation occurs, an application must attempt to provide as much of the requested data beginning at the [`requestedOffset`](/documentation/AVFoundation/AVAssetResourceLoadingDataRequest/requestedOffset) property as the resource contains. The application must then invoke either the [`AVAssetResourceLoadingRequest`](/documentation/AVFoundation/AVAssetResourceLoadingRequest) instance’s [`finishLoading()`](/documentation/AVFoundation/AVAssetResourceLoadingRequest/finishLoading()) method upon success, or the [`finishLoading(with:)`](/documentation/AVFoundation/AVAssetResourceLoadingRequest/finishLoading(with:)) method if an error is encountered during the loading.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)