Skip to content

Expose Buffer.completeSegmentByteCount or equivalent #469

@JakeWharton

Description

@JakeWharton

As far as I can tell there's no way to replicate this functionality in the current public API.

Segment.owner isn't exposed, so a UnsafeBufferOperations.forEachSegment aggregation can't know if segments are safely full or not. This also comes into play if you've done a UnsafeBufferOperations.moveToTail of a non-standard size and it becomes unclear if Segment.remainingCapacity can be relied upon since it doesn't check owner flag.

I'm trying to do a compression loop where I only invoke the expensive compressor operation on completed segments (until flush/EOF).

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions