tus/tus-java-client

SetChunkSize in Readme is wrong

Extazx2 opened this issue · 3 comments

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

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?

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.

Glad to help you :)