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

Đang mở
#2,269 8 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
38/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
java
Lĩnh vực
api

Hướng nghiên cứu

Bắt đầu từ lệnh gọi graphServiceClient.drives().byDriveId(...).content().get() và kiểm tra cách Java InputStream được trả về xử lý read(byte[]) đối với các lượt tải xuống từ SharePoint. So sánh các lần đọc 8K đã quan sát được với contract của Java InputStream và phần triển khai stream của SDK; công việc được xem là hoàn tất khi hành vi buffering được yêu cầu либо được sửa hoặc được bao phủ rõ ràng bằng một regression test.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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_
Ngôn ngữ chính
Java
Star
444
Fork
154
Merge trung bình
18 giờ 28 phút
Pull request đã merge (30 ngày)
4

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của microsoftgraph/msgraph-sdk-java

Tất cả issue của microsoftgraph/msgraph-sdk-java

Issue tương tự

Thêm issue về Java

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.