Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SetChunkSize in Readme is wrong #36

Closed
Extazx2 opened this issue Sep 15, 2020 · 3 comments
Closed

SetChunkSize in Readme is wrong #36

Extazx2 opened this issue Sep 15, 2020 · 3 comments
Labels

Comments

@Extazx2
Copy link

Extazx2 commented Sep 15, 2020

Describe the bug
The comment above the setChunkSize line in the readme says you can pass a KB value (with 1024 as value).
But the method take the value and create Byte array with that value, without multiplicating it.

In the constructor however, it is written 2 x 1024 x 1024 which is 2 MB as Bytes

https://github.com/tus/tus-java-client/blob/master/src/main/java/io/tus/java/client/TusUploader.java

@Extazx2 Extazx2 added the bug label Sep 15, 2020
@Acconut
Copy link
Member

Acconut commented Sep 15, 2020

Are you referring to these lines?

// Upload the file in chunks of 1KB sizes.
uploader.setChunkSize(1024);

I don't think they are wrong since 1KB = 1024 bytes. The number you pass to setChunkSize is interpreted as the number of bytes, not as kilobytes. Does that help?

@Extazx2
Copy link
Author

Extazx2 commented Sep 15, 2020

Oh ok, It confused me, I thought that the value inside, was Value * 1 kb

So in the example : 1024 * 1 kb = 1024 kb, but in fact it was 1024 bytes

Thanks for the explaination.

@Extazx2 Extazx2 closed this as completed Sep 15, 2020
@Acconut
Copy link
Member

Acconut commented Sep 15, 2020

Glad to help you :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants