Advance deprecation level of InputStream.readBytes(estimatedSize) to ERROR
This commit is contained in:
+1
-1
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user