public class ReaderBodyHttpServletRequestWrapper
extends javax.servlet.http.HttpServletRequestWrapper
byte[],然后将
ServletRequestWrapper.getReader() 和
ServletRequestWrapper.getInputStream() 方法的流的读取指向 byte[],
使这两个方法支持多次读取,默认只能读取一次。并且能支持 InputStream.reset() 操作,把pos的指针的位置重置为起始位置。ByteArrayServletInputStream| Constructor and Description |
|---|
ReaderBodyHttpServletRequestWrapper(javax.servlet.http.HttpServletRequest request)
创建HttpServletRequestWrapper包装类
|
| Modifier and Type | Method and Description |
|---|---|
javax.servlet.ServletInputStream |
getInputStream() |
BufferedReader |
getReader() |
authenticate, changeSessionId, getAuthType, getContextPath, getCookies, getDateHeader, getHeader, getHeaderNames, getHeaders, getHttpServletMapping, getIntHeader, getMethod, getPart, getParts, getPathInfo, getPathTranslated, getQueryString, getRemoteUser, getRequestedSessionId, getRequestURI, getRequestURL, getServletPath, getSession, getSession, getTrailerFields, getUserPrincipal, isRequestedSessionIdFromCookie, isRequestedSessionIdFromUrl, isRequestedSessionIdFromURL, isRequestedSessionIdValid, isTrailerFieldsReady, isUserInRole, login, logout, newPushBuilder, upgradegetAsyncContext, getAttribute, getAttributeNames, getCharacterEncoding, getContentLength, getContentLengthLong, getContentType, getDispatcherType, getLocalAddr, getLocale, getLocales, getLocalName, getLocalPort, getParameter, getParameterMap, getParameterNames, getParameterValues, getProtocol, getRealPath, getRemoteAddr, getRemoteHost, getRemotePort, getRequest, getRequestDispatcher, getScheme, getServerName, getServerPort, getServletContext, isAsyncStarted, isAsyncSupported, isSecure, isWrapperFor, isWrapperFor, removeAttribute, setAttribute, setCharacterEncoding, setRequest, startAsync, startAsyncclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetAsyncContext, getAttribute, getAttributeNames, getCharacterEncoding, getContentLength, getContentLengthLong, getContentType, getDispatcherType, getLocalAddr, getLocale, getLocales, getLocalName, getLocalPort, getParameter, getParameterMap, getParameterNames, getParameterValues, getProtocol, getRealPath, getRemoteAddr, getRemoteHost, getRemotePort, getRequestDispatcher, getScheme, getServerName, getServerPort, getServletContext, isAsyncStarted, isAsyncSupported, isSecure, removeAttribute, setAttribute, setCharacterEncoding, startAsync, startAsyncpublic ReaderBodyHttpServletRequestWrapper(javax.servlet.http.HttpServletRequest request)
request - HttpServletRequestpublic BufferedReader getReader() throws IOException
getReader in interface javax.servlet.ServletRequestgetReader in class javax.servlet.ServletRequestWrapperIOExceptionpublic javax.servlet.ServletInputStream getInputStream()
throws IOException
getInputStream in interface javax.servlet.ServletRequestgetInputStream in class javax.servlet.ServletRequestWrapperIOExceptionCopyright © 2018–2019. All rights reserved.