-
Notifications
You must be signed in to change notification settings - Fork 2
Stream
Evan Swick edited this page Feb 19, 2016
·
2 revisions
A Stream
is a protocol used for reading and writing to sequential data streams.
-
canRead: Bool
- Whether this stream supports being read from
-
canWrite: Bool
- Whether this stream supports being written to
-
canTimeout: Bool
- Whether this stream supports timing out
-
canSeek: Bool
- Whether this stream supports seeking
-
position: Int64
- The stream's current position
-
readTimeout: UInt
- The time (in milliseconds) a read operation must complete by
-
writeTimeout: UInt
- The time (in milliseconds) a write operation must complete by
-
read(count: Int64) throws -> [UInt8]
- Attempts to read
count
or less bytes from the stream
- Attempts to read
-
write(bytes: [UInt8]) throws -> Int
- Attempts to write
bytes
to the stream, returning the number of bytes successfully written
- Attempts to write
-
seek(offset: Int64, origin: SeekOrigin) throws
- Attempts to move the stream's position
offset
bytes fromorigin
- Attempts to move the stream's position
-
close() throws
- Attempts to close the stream
Copyright © 2016 Evan Swick