I am designing an archive format(Just for fun) in Java using this template-
First 4 bytes: Number of files in the archive
Next 4 bytes: Number of bytes in the filename
Next N bytes: Filename
Next 10 bytes: Number of bytes in the file
Next N bytes: File contents
from PHP Safe way to download mutliple files and save them.
I am having on trouble with finding the values of the number of files etc. but I don't know how to expand an integer into 4 bytes.
Is it similar to this- How do I truncate a java string to fit in a given number of bytes, once UTF-8 encoded?