googleapis / googleapis/java-storage

Support `InputStream` as a source of `RequestBody`

Offen
#3,554 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
api: storage
Vorherrschende Sprache
Java
Sterne
141
Forks
93
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

**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.

Beitragsleitfaden

Beitragsleitfaden öffnen

Rechercherichtung

Start by locating the RequestBody construction API and the RewindableContent implementation, then compare how the existing ByteBuffer source is handled. Determine the required mark/reset behavior for an InputStream and verify that the new source avoids the intermediate copy while remaining rewindable.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
java
Bereich
api
Issue-Typ
Feature
Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Aktivitätsstatus
Ruhig
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
55/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.