<!--
{
  "availability" : [
    "iOS: 4.0.0 -",
    "iPadOS: 4.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.0.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Foundation",
  "identifier" : "/documentation/Foundation/FileWrapper/serializedRepresentation",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Property",
  "symbol" : {
    "kind" : "Instance Property",
    "modules" : [
      "Foundation"
    ],
    "preciseIdentifier" : "c:objc(cs)NSFileWrapper(py)serializedRepresentation"
  },
  "title" : "serializedRepresentation"
}
-->

# serializedRepresentation

The contents of the file wrapper as an opaque data object.

```
var serializedRepresentation: Data? { get }
```

## Discussion

This property contains a data object in the format used by the <doc://com.apple.documentation/documentation/AppKit/NSPasteboard/PasteboardType/fileContents> pasteboard type. This data object is also suitable for passing to [`init(serializedRepresentation:)`](/documentation/Foundation/FileWrapper/init(serializedRepresentation:)).

This property may be `nil` if the user modifies the contents of the file system node after you call [`read(from:options:)`](/documentation/Foundation/FileWrapper/read(from:options:)) or [`init(url:options:)`](/documentation/Foundation/FileWrapper/init(url:options:)-70161), but before [`FileWrapper`](/documentation/Foundation/FileWrapper) has read the contents of the file.  You can use the [`immediate`](/documentation/Foundation/FileWrapper/ReadingOptions/immediate) reading option to reduce the likelihood of this problem.

## See Also

[`-  initWithSerializedRepresentation:`](/documentation/Foundation/FileWrapper/init(serializedRepresentation:))

Initializes the receiver as a regular-file file wrapper from given serialized data.



---

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)