I'm trying to take some files/file content from a GCS storage bucket, add them to a ZIP archive, and save that archive file in a GCS bucket using a Java Cloud Function.
I'm able to read files and write normal (non-zip) files just fine. However, I'm unclear on how I could use the available Java API (bucket.create(String fileName, byte[] content
) to post a ZIP archive. I have the bytes of the individual files I want to archive but how do I get the bytes of the ZIP file itself? Or is there another API I should be looking at?
I can't find any examples of doing this in Java. I found this source about how to do this in Python and this Stack Overflow article on how to do it within Google App Engine, but neither of these apply to my use case.