Compressed empty bytes need to be Handle


I had written a java code in which it handle compressed files in which if byte content is not empty but now I need even though the byte content is empty the data should be decompressed or unzip.Below is the code which is working for unzipped or uncompressed with out empty.

Finally i need an empty bytes to be unzipped

Could any one please help me.

Input: bytes



public static final void unzipBytesToStream(IData pipeline)
throws ServiceException {
// pipeline
IDataCursor pipelineCursor = pipeline.getCursor();
Object bytesObj = IDataUtil.get( pipelineCursor, “bytes” );

	if (!(bytesObj instanceof byte[])) {
		throw new ServiceException("Bytes must be a byte array!");
	try { zipIS = new ByteArrayInputStream((byte[]) bytesObj));
		// pipeline
		pipelineCursor = pipeline.getCursor();
		IDataUtil.put( pipelineCursor, "stream", zipIS );
	catch (IOException e) {
		throw new IllegalArgumentException("Invalid content: " + e.getMessage());


If zip(empty)=empty then unzip(empty)=empty too?

So if you could add a check for an empty input before calling the unzip service, you could return an empty output.

Would this work?

Best Regards,