Advance deprecation level of InputStream.readBytes(estimatedSize) to ERROR

This commit is contained in:
Abduqodiri Qurbonzoda
2021-03-27 05:01:32 +03:00
parent d520c37454
commit e8992c5d19
2 changed files with 2 additions and 2 deletions
@@ -3,5 +3,5 @@ import java.io.InputStream
fun InputStream.test() {
readBytes()
<!DEPRECATION!>readBytes<!>(1)
<!DEPRECATION_ERROR!>readBytes<!>(1)
}
@@ -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)