Deprecate StreamUtils.emptyInput()

Closes gh-29125
This commit is contained in:
Brian Clozel
2022-09-09 22:43:40 +02:00
parent d4a74c8f9d
commit 0770d86936
14 changed files with 29 additions and 34 deletions

View File

@@ -28,7 +28,6 @@ import org.apache.http.util.EntityUtils;
import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpStatusCode;
import org.springframework.lang.Nullable;
import org.springframework.util.StreamUtils;
/**
* {@link ClientHttpResponse} implementation based on
@@ -84,7 +83,7 @@ final class HttpComponentsClientHttpResponse implements ClientHttpResponse {
@Override
public InputStream getBody() throws IOException {
HttpEntity entity = this.httpResponse.getEntity();
return (entity != null ? entity.getContent() : StreamUtils.emptyInput());
return (entity != null ? entity.getContent() : InputStream.nullInputStream());
}
@Override

View File

@@ -26,7 +26,6 @@ import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpStatusCode;
import org.springframework.lang.Nullable;
import org.springframework.util.Assert;
import org.springframework.util.StreamUtils;
/**
* {@link ClientHttpResponse} implementation based on OkHttp 3.x.
@@ -69,7 +68,7 @@ class OkHttp3ClientHttpResponse implements ClientHttpResponse {
@Override
public InputStream getBody() throws IOException {
ResponseBody body = this.response.body();
return (body != null ? body.byteStream() : StreamUtils.emptyInput());
return (body != null ? body.byteStream() : InputStream.nullInputStream());
}
@Override

View File

@@ -73,7 +73,7 @@ public class SourceHttpMessageConverter<T extends Source> extends AbstractHttpMe
(publicId, systemId) -> new InputSource(new StringReader(""));
private static final XMLResolver NO_OP_XML_RESOLVER =
(publicID, systemID, base, ns) -> StreamUtils.emptyInput();
(publicID, systemID, base, ns) -> InputStream.nullInputStream();
private static final Set<Class<?>> SUPPORTED_CLASSES = new HashSet<>(8);