googleapis / googleapis/java-storage
Support `InputStream` as a source of `RequestBody`
- Lingua principale
- Java
- Stelle
- 141
- Fork
- 93
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Descrizione
**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.
Guida per i contributori
Apri la guida per i contributori
Direzione di ricerca
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.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- java
- Ambito
- api
- Tipo di issue
- Funzionalità
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Stato di attività
- Tranquilla
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 55/100