8326096: Deprecate getTotalIn, getTotalOut methods of java.util.zip.Inflater, java.util.zip.Deflater

Co-authored-by: Jaikiran Pai <jpai@openjdk.org>
Reviewed-by: lancea, alanb
This commit is contained in:
Eirik Bjørsnøs 2024-03-08 09:38:30 +00:00
parent c65da92a80
commit d0d4912c3b
2 changed files with 28 additions and 12 deletions

View file

@ -822,12 +822,16 @@ public class Deflater {
/**
* Returns the total number of uncompressed bytes input so far.
*
* <p>Since the number of bytes may be greater than
* Integer.MAX_VALUE, the {@link #getBytesRead()} method is now
* the preferred means of obtaining this information.</p>
* @implSpec
* This method returns the equivalent of {@code (int) getBytesRead()}
* and therefore cannot return the correct value when it is greater
* than {@link Integer#MAX_VALUE}.
*
* @deprecated Use {@link #getBytesRead()} instead
*
* @return the total number of uncompressed bytes input so far
*/
@Deprecated(since = "23")
public int getTotalIn() {
return (int) getBytesRead();
}
@ -848,12 +852,16 @@ public class Deflater {
/**
* Returns the total number of compressed bytes output so far.
*
* <p>Since the number of bytes may be greater than
* Integer.MAX_VALUE, the {@link #getBytesWritten()} method is now
* the preferred means of obtaining this information.</p>
* @implSpec
* This method returns the equivalent of {@code (int) getBytesWritten()}
* and therefore cannot return the correct value when it is greater
* than {@link Integer#MAX_VALUE}.
*
* @deprecated Use {@link #getBytesWritten()} instead
*
* @return the total number of compressed bytes output so far
*/
@Deprecated(since = "23")
public int getTotalOut() {
return (int) getBytesWritten();
}