tus / tus-java-client

The tus client for Java.
https://tus.io
MIT License
213 stars 88 forks source link

SetChunkSize in Readme is wrong #36

Closed Extazx2 closed 4 years ago

Extazx2 commented 4 years ago

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

Acconut commented 4 years ago

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 commented 4 years ago

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.

Acconut commented 4 years ago

Glad to help you :)