[java-storage] Support `InputStream` as a source of `RequestBody`

Open
#14,518 0 comments 0 reactions 1 assignee View on GitHub

Maintainers usually reply within 1 day

@Dhriti07 is already working on this.

Since Sep 29, 2026.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
55/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Quiet
Tech stack
java
Domain
api, backend

Research direction

Start by locating RequestBody and RewindableContent, then trace the existing ByteBuffer construction and rewind behavior. Verify how InputStream mark/reset support would affect repeated reads; done means callers can construct RequestBody from an InputStream without an intermediate buffer while rewinding remains supported.

Written by the indexing model from the issue text.

Description

api: storage

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.

Dominant language
Java
Stars
2.1k
Forks
1.2k
Avg merge
2d 14h
Merged PRs (30d)
192

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from googleapis/google-cloud-java

All issues in googleapis/google-cloud-java

Similar issues

More Java issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.