类 DelegatingServletInputStream
- java.lang.Object
- java.io.InputStream
- javax.servlet.ServletInputStream
- org.springframework.mock.web.DelegatingServletInputStream
- 所有已实现的接口:
Closeable
,AutoCloseable
public class DelegatingServletInputStream extends ServletInputStream
Delegating implementation ofServletInputStream
.Used by
MockHttpServletRequest
; typically not directly used for testing application controllers.- 从以下版本开始:
- 1.0.2
- 作者:
- Juergen Hoeller
- 另请参阅:
MockHttpServletRequest
构造器概要
构造器 构造器 说明 DelegatingServletInputStream(InputStream sourceStream)
Create a DelegatingServletInputStream for the given source stream.
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 void
close()
InputStream
getSourceStream()
Return the underlying source stream (nevernull
).int
read()
从类继承的方法 javax.servlet.ServletInputStream
isFinished, isReady, readLine, setReadListener
从类继承的方法 java.io.InputStream
available, mark, markSupported, nullInputStream, read, read, readAllBytes, readNBytes, readNBytes, reset, skip, transferTo
构造器详细资料
DelegatingServletInputStream
public DelegatingServletInputStream(InputStream sourceStream)
Create a DelegatingServletInputStream for the given source stream.- 参数:
sourceStream
- the source stream (nevernull
)
方法详细资料
getSourceStream
public final InputStream getSourceStream()
Return the underlying source stream (nevernull
).
read
public int read() throws IOException
- 指定者:
read
在类中InputStream
- 抛出:
IOException
close
public void close() throws IOException
- 指定者:
close
在接口中AutoCloseable
- 指定者:
close
在接口中Closeable
- 覆盖:
close
在类中InputStream
- 抛出:
IOException