<!--
{
  "availability" : [
    "iOS: 14.0.0 -",
    "iPadOS: 14.0.0 -",
    "macCatalyst: -",
    "macOS: 11.0.0 -",
    "tvOS: 14.0.0 -",
    "visionOS: -",
    "watchOS: 7.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "AppleArchive",
  "identifier" : "/documentation/AppleArchive/ArchiveByteStreamProtocol/seek(toOffset:relativeTo:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Apple Archive"
    ],
    "preciseIdentifier" : "s:12AppleArchive0B18ByteStreamProtocolP4seek8toOffset10relativeTos5Int64VAH_6System14FileDescriptorV10SeekOriginVtKF"
  },
  "title" : "seek(toOffset:relativeTo:)"
}
-->

# seek(toOffset:relativeTo:)

Updates the internal stream position to the specified offset relative to the specified origin.

```
func seek(toOffset offset: Int64, relativeTo origin: FileDescriptor.SeekOrigin) throws -> Int64
```

## Parameters

`offset`

The offset relative to the reference position from which to seek.

`origin`

The reference position from which to seek.

## Return Value

The new internal stream position that is relative to the beginning of the stream.

---

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)