Skip to content

OutputStream.available always retrun 0 #28

Open
@sequencer

Description

@sequencer

I wanna peek the how many bytes in OutputStream that I can read, in case of blocked by process.
However I found when I use sub.stdout.available, it always returns 0, seems available didn't implemented by os.OutputStream nor java.lang.ProcessPipeInputStream.
Thus there might be no way to implement a non-block reading by os-lib

Activity

scalway

scalway commented on Jun 7, 2022

@scalway

@sequencer you can always use _.wrapped.available but yea... it is long standing bug.
Still... _.available does not guarantee anything. Spec says it is only estimation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      `OutputStream.available` always retrun 0 · Issue #28 · com-lihaoyi/os-lib