googleapis / googleapis/java-storage

Support `InputStream` as a source of `RequestBody`

オープン
#3,554 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る
api: storage
主要言語
Java
スター
141
フォーク
93
PR マージ指標
30日以内にマージされた PR はありません

説明

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

コントリビューションガイド

コントリビューションガイドを開く

調査の方向性

まず RequestBody の構築 API と RewindableContent の実装を見つけ、既存の ByteBuffer ソースがどのように処理されているかを比較します。InputStream に必要な mark/reset の動作を特定し、新しいソースが中間コピーを避けながら rewindable であり続けることを確認します。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
java
領域
api
issue の種類
機能追加
難易度
4/5
見積もり時間
3〜5日
活発さ
静か
明瞭さ
おおむね明確
初心者へのやさしさ
55/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。