Skip to content

IO#rewind ... doesn't. (when backed by a ByteArrayInputStream). #2381

@headius

Description

@headius

From: http://jira.codehaus.org/browse/JRUBY-5891. Works in 1.7.18 and not on master.

See: https://gist.github.com/1043829 which includes a test case.

If you have a ByteArrayInputStream, then call #to_io on it, then you read from the stream and #rewind it, the offset into the stream doesn't change. I believe this is due to lseek dropping out the bottom of a conditional when it should perhaps throw an exception.

I am happy to provide a JUnit test and patch if folks agree with me that this is the wrong behavior. I just spent the better part of a day fixing broken behavior whose genesis was this issue.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions