---
title: "seek(toOffset:relativeTo:)"
framework: applearchive
role: symbol
role_heading: Instance Method
path: "applearchive/archivebytestreamprotocol/seek(tooffset:relativeto:)"
---

# seek(toOffset:relativeTo:)

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

## Declaration

```swift
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

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

## See Also

### Using Archive Byte Streams

- [cancel()](applearchive/archivebytestreamprotocol/cancel().md)
- [close()](applearchive/archivebytestreamprotocol/close().md)
