ZnEncodedStream>>setToEnd simply defers to the underlying stream—sensible enough—but the call to #ensureAtBeginOfCodePointOnStream: in #position: encounters an error if the provided position corresponds to end-of-stream. I've seen this come up when writing a method that uses a save/move/restore position pattern, where the position it happens to save is at end-of-stream.
Seems like an easy fix, just early-out of #ensureAtBeginOfCodePointOnStream: if the stream is atEnd—I'll make a PR soon.
ZnEncodedStream>>setToEnd
simply defers to the underlying stream—sensible enough—but the call to#ensureAtBeginOfCodePointOnStream:
in#position:
encounters an error if the provided position corresponds to end-of-stream. I've seen this come up when writing a method that uses a save/move/restore position pattern, where the position it happens to save is at end-of-stream.Seems like an easy fix, just early-out of
#ensureAtBeginOfCodePointOnStream:
if the stream is atEnd—I'll make a PR soon.