Skip to content

Source::readFully inconsistent with other read methods #139

Closed
@fzhinkin

Description

@fzhinkin

Most of Source's read* methods don't consume any data from the source if there are not enough bytes to complete an operation. For example, Source::readLong called on a source containing less than 8 bytes will throw the EOFException, and bytes buffered by the source will remain untouched and available for reading.

At the same time, Source::readFully(sink: RawSink, byteCount: Long) will consume data from the source even if the operation is terminated with an exception due to the source containing less than byteCount bytes.

The latter is inconsistent with other read operations and should be fixed (or there should be a reason for it to behave in such a way).

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions