Skip to content

Commit 969d6e8

Browse files
sichanyooSichan Yoo
andauthored
fix: Fix FileStream initializer that causes out of memory exception (#905)
Co-authored-by: Sichan Yoo <[email protected]>
1 parent 5757a0c commit 969d6e8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Sources/SmithyStreams/FileStream.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public final class FileStream: Stream, @unchecked Sendable {
4141
/// Initializes a new `FileStream` instance.
4242
public init(fileHandle: FileHandle) {
4343
self.fileHandle = fileHandle
44-
self.position = fileHandle.availableData.startIndex
44+
self.position = Int(fileHandle.offsetInFile)
4545
}
4646

4747
/// Reads up to `count` bytes from the stream.

0 commit comments

Comments
 (0)