Today we'll prepare to implement ZipContentCommand. It will be responsible for getting
an archive's contents. The archive's contents are compressed files and folders, but we're interested
in knowing not only the names of the archive's objects, but also their size before and after compression.
Archiver (part 12)
- 16
Locked
Comments (5)
- Popular
- New
- Old
You must be signed in to leave a comment
TomL
20 March 2022, 21:34
}
Please help me, I don't see where the mistake is. I convert B to KB by 1024.0 - the result is double and format it with %.2f and then compress ratio as long format with %d. What I don't see? I've tested it separately with same kind of values and it works fine. 0
TomL
20 March 2022, 21:41
I passed with the most stupid thing: everything formatted with %d. Soo, If my input file has for example size 1048B and compressed size is 257B, then the output is 1 KB (0 KB). Oh, common. If I do it as it should be, then I don't pass the control. This part of control doesn't work correctly!
0
klesk
18 February 2021, 14:22
They want Kibibytes, not Kilobytes.
0
Guadalupe Gagnon
4 May 2019, 15:37
"name size KB (compressedSize KB) compression: getCompressionRatio()%"
Here is what they are asking for on the toString() method, where the bold parts are variable or method calls. Make sure that you convert bytes to kilobytes as per computer science and not per the metric system.
+2
jorge ives murillo paredes
19 April 2020, 05:26
thanks bro,you help a lot.
+1