Deflater getTotalIn() function in Java with examples
The getTotalIn() function of the Deflater class in java.util.zip returns the total number of uncompressed bytes input provided till now.
public int getTotalIn()
Parameter: The function requires no parameter
Return Type: The function returns an int value which is the total number of uncompressed bytes input.
Exception: The function does not throw any exception
Compressed String :x?sOM?.N?/r???q?? Size 21 Original String :GeeksforGeeksGeeksforGeeksGeeksforGeeksGeeksforGeeks Size 52 Total In value :52
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.