Deflater getTotalOut() function in Java with examples
The getTotalOut() function of the Deflater class in java.util.zip returns the total number of compressed bytes Output provided till now.
public int getTotalOut()
Parameter: The function requires no parameter
Return Type: The function returns an int value which is the total number of compressed bytes Output.
Exception: The function does not throw any exception
Compressed String :x?sOM?.N?/r???q?? Size 21 Original String :GeeksforGeeksGeeksforGeeksGeeksforGeeksGeeksforGeeks Size 52 Total Output value :21
Note: The problem arises when the length of the input is greater than Integer.MAX_VALUE. Then the result may overflow, we should use getBytesRead() function instead
Attention reader! Don’t stop learning now. Get hold of all the important Java Foundation and Collections concepts with the Fundamentals of Java and Java Collections Course at a student-friendly price and become industry ready. To complete your preparation from learning a language to DS Algo and many more, please refer Complete Interview Preparation Course.