in code
GZIPInputStream gzis= new GZIPInputStream(bais);
byte[] bBodyUnzipped= new byte[10240];
gzis.read(bBodyUnzipped);
, how can I optimize the disk space usage and not create a big byte[] by knowing the file unzipped length?
According to this answer there is not such method.
The idea is to use this byte[] for calling
CharsetDecoder decoder = Charset.forName("UTF-8").newDecoder();
String sBodyUnzipped= decoder.decode(ByteBuffer.wrap(bBodyUnzipped)).toString();
For this reason I need a bytye[] with all the content and no extra zeroes.