StreamUtils.emptyInput() for consistent empty InputStream exposure

Issue: SPR-13563
This commit is contained in:
Juergen Hoeller
2015-10-12 22:25:40 +02:00
parent 6256586047
commit 66177dfd8c
9 changed files with 36 additions and 31 deletions

View File

@@ -39,7 +39,6 @@ import java.util.Locale;
import java.util.Map;
import java.util.Set;
import java.util.TimeZone;
import javax.servlet.AsyncContext;
import javax.servlet.DispatcherType;
import javax.servlet.RequestDispatcher;
@@ -59,6 +58,7 @@ import org.springframework.util.Assert;
import org.springframework.util.LinkedCaseInsensitiveMap;
import org.springframework.util.LinkedMultiValueMap;
import org.springframework.util.MultiValueMap;
import org.springframework.util.StreamUtils;
import org.springframework.util.StringUtils;
/**
@@ -122,7 +122,7 @@ public class MockHttpServletRequest implements HttpServletRequest {
private static final String CHARSET_PREFIX = "charset=";
private static final ServletInputStream EMPTY_SERVLET_INPUT_STREAM =
new DelegatingServletInputStream(new ByteArrayInputStream(new byte[0]));
new DelegatingServletInputStream(StreamUtils.emptyInput());
/**
* Date formats as specified in the HTTP RFC