From e8992c5d19cc30cb8fd5bcf93b9932a86e920d96 Mon Sep 17 00:00:00 2001 From: Abduqodiri Qurbonzoda Date: Sat, 27 Mar 2021 05:01:32 +0300 Subject: [PATCH] Advance deprecation level of InputStream.readBytes(estimatedSize) to ERROR --- .../testsWithStdLib/deprecated/deprecationOnReadBytes.kt | 2 +- libraries/stdlib/jvm/src/kotlin/io/IOStreams.kt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/compiler/testData/diagnostics/testsWithStdLib/deprecated/deprecationOnReadBytes.kt b/compiler/testData/diagnostics/testsWithStdLib/deprecated/deprecationOnReadBytes.kt index 2662e5662d2..273823eeece 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/deprecated/deprecationOnReadBytes.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/deprecated/deprecationOnReadBytes.kt @@ -3,5 +3,5 @@ import java.io.InputStream fun InputStream.test() { readBytes() - readBytes(1) + readBytes(1) } diff --git a/libraries/stdlib/jvm/src/kotlin/io/IOStreams.kt b/libraries/stdlib/jvm/src/kotlin/io/IOStreams.kt index 2dcb3e94054..47fe2a56c94 100644 --- a/libraries/stdlib/jvm/src/kotlin/io/IOStreams.kt +++ b/libraries/stdlib/jvm/src/kotlin/io/IOStreams.kt @@ -118,7 +118,7 @@ public fun InputStream.copyTo(out: OutputStream, bufferSize: Int = DEFAULT_BUFFE * **Note**: It is the caller's responsibility to close this stream. */ @Deprecated("Use readBytes() overload without estimatedSize parameter", ReplaceWith("readBytes()")) -// TODO: Add DeprecatedSince when available +@DeprecatedSinceKotlin(warningSince = "1.3", errorSince = "1.5") public fun InputStream.readBytes(estimatedSize: Int = DEFAULT_BUFFER_SIZE): ByteArray { val buffer = ByteArrayOutputStream(maxOf(estimatedSize, this.available())) copyTo(buffer)