Skip to content

Support InputStream as a source of RequestBody #3554

Description

@lkts

Is your feature request related to a problem? Please describe.
Currently RequestBody can only be constructed from ByteBuffer. If a caller wants to supply data from an InputStream this API forces an allocation and copy of the data in the stream into an intermediate buffer.

Describe the solution you'd like
I would like to be able to create RequestBody from an InputStream. It seems that mark and reset functionality can be used to implement rewinding in RewindableContent.

Describe alternatives you've considered
I can use an intermediate buffer solution and it works but it's not ideal.

Activity

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

    api: storageIssues related to the googleapis/java-storage API.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions