You should end up with something like this (assuming the ZIP file has only a single entry):
final bytes = // ... the zip file's byte[]
final zipInput = new ZipInputStream(new ByteArrayInputStream(bytes))
final output = new ByteArrayOutputStream()
zipInput.withStream {
def entry = zipInput.nextEntry
int len = 0;
byte[] buffer = new byte[4096]
while ((len = zipInput.read(buffer)) > 0){
output.write(buffer, 0, len);
}
}
I am currently underway and don't have access to my dev environment, but this example should give you a glimpse on how to solve this issue.
Cheers, André