-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
BREAKING:
eof
errors if stream isn't readable (#230)
Co-authored-by: Mark Kittisopikul <[email protected]>
- Loading branch information
Showing
5 changed files
with
51 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
Migration | ||
========= | ||
|
||
How to migrate from v0.10 to v0.11 | ||
---------------------------------- | ||
|
||
v0.11 has a few subtle breaking changes to `eof` and `seekend`. | ||
|
||
### `Memory(data::ByteData)` | ||
|
||
The `Memory(data::ByteData)` constructor was removed. | ||
Use `Memory(pointer(data), sizeof(data))` instead. | ||
|
||
### `seekend(stream::TranscodingStream)` | ||
|
||
Generic `seekend` for `TranscodingStream` was removed. | ||
If the objective is to discard all remaining data in the stream, use `skip(stream, typemax(Int64))` instead where `typemax(Int64)` is meant to be a large number to exhaust the stream. | ||
Ideally, specific implementations of `TranscodingStream` will implement `seekend` only if efficient means exist to avoid fully processing the stream. | ||
`NoopStream` still supports `seekend`. | ||
|
||
The previous behavior of the generic `seekend` was something like | ||
`(seekstart(stream); seekend(stream.stream); stream)` but this led to | ||
inconsistencies with the position of the stream. | ||
|
||
### `eof(stream::TranscodingStream)` | ||
|
||
`eof` now throws an error if called on a stream that is closed or in writing mode. | ||
Use `!isreadable(stream) || eof(stream)` if you need to more closely match previous behavior. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters