When downoading from sharepoint with buffer size always getting maximum 8K buffer and not as we asked

未關閉
#2,269 8 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

還沒有人認領這個 Issue。

評估

難度
3/5
預估耗時
1-2 天
新手友好度
38/100
Issue 類型
缺陷
描述清晰度
基本清楚
活躍度
停滯
技術堆疊
java
領域
api

研究方向

從 graphServiceClient.drives().byDriveId(...).content().get() 呼叫開始,檢查傳回的 Java InputStream 如何為 SharePoint 下載處理 read(byte[])。將觀察到的 8K 讀取與 Java InputStream 的契約以及 SDK 的串流實作進行比較;當所要求的緩衝行為獲得修正,或由回歸測試明確涵蓋時,即表示完成。

由索引模型根據 Issue 內容生成。

描述

Needs: Attention :wave: type:question
Describe the bug

When downloading file from sharepoint using graph api and set the buffer size to be downloaded only 8K ( maximum) is fetched ) instread of the given buffer size.
InputStream inputStream = graphServiceClient.drives().byDriveId(driveId).items().byDriveItemId(getDriveItemIdFromRootPath(filePath)).content().get();
byte[] buf = new byte[cloudPartSizeWhenDownloadingToLocal];
int bytesRead;
while ((bytesRead = srcInputStream.read(buf)) != -1) {
byresRead is always maximum 8K and not per demand
}

Expected behavior

The bytess returned from this method should aline with the request.

How to reproduce

see above

SDK Version

6.25.1

Latest version known to work for scenario above?

No response

Known Workarounds

No response

Debug output
Click to expand log ```
</details>


### Configuration

_No response_

### Other information

_No response_
主要語言
Java
星號
444
分支
154
平均合併
18 小時 28 分鐘
30 天內合併 PR
4

貢獻指南

開啟貢獻指南

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

microsoftgraph/msgraph-sdk-java 的其他 Issue

查看 microsoftgraph/msgraph-sdk-java 的全部 Issue

相似的 Issue

更多 Java Issue

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。