Hi Camel,
Is there a way to unzip huge file by using streaming? I got OutOfMemoryError if 
the uncompressed file size (4GB). I tried to use custom unzip processor with 
streaming and it works fine. 
Very appreciated if you have a solution. 
/* Unzip .gz file route */
from("file:...")
.unmarshal().gzipDeflater()

.to("file:...");


/* Unzip .gz file using custom processor */
from("file:...")
.processor("unzipProcessor");


/* unzipProcessor -> 9 seconds to unzip for uncompressed file (4GB) */
byte[] buffer = new byte[102400];

int length;

FileInputStream fis = new FileInputStream(fileName);
GZIPInputStream gzis = new GZIPInputStream(fis);
FileOutputStream fos = new FileOutputStream("d:\\temp\\test.json");
while ((length = gzis.read(buffer)) > 0) {
 fos.write(buffer, 0, length);
}

Reply via email to