Package org.red5.server.net.servlet
Class ServletUtils
java.lang.Object
org.red5.server.net.servlet.ServletUtils
-
Field Summary
Modifier and TypeFieldDescriptionstatic final int
Default value is 2048.private static org.slf4j.Logger
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
copy
(jakarta.servlet.http.HttpServletRequest req, OutputStream output) Copies information from the http request to the output stream using the specified content length.static void
copy
(InputStream input, OutputStream output) Copies information from the input stream to the output stream using a default buffer size of 2048 bytes.static void
copy
(InputStream input, OutputStream output, int bufferSize) Copies information from the input stream to the output stream using the specified buffer sizestatic void
copyThenClose
(InputStream input, OutputStream output) Copies information between specified streams and then closes both of the streams.static byte[]
getBytes
(InputStream input) getRemoteAddresses
(jakarta.servlet.http.HttpServletRequest request) Return all remote addresses that were involved in the passed request.
-
Field Details
-
log
private static org.slf4j.Logger log -
DEFAULT_BUFFER_SIZE
public static final int DEFAULT_BUFFER_SIZEDefault value is 2048.- See Also:
-
-
Constructor Details
-
ServletUtils
public ServletUtils()
-
-
Method Details
-
copy
Copies information from the input stream to the output stream using a default buffer size of 2048 bytes.- Parameters:
input
- inputoutput
- output- Throws:
IOException
- on error
-
copy
Copies information from the input stream to the output stream using the specified buffer size- Parameters:
input
- inputbufferSize
- buffer sizeoutput
- output- Throws:
IOException
- on error
-
copy
public static void copy(jakarta.servlet.http.HttpServletRequest req, OutputStream output) throws IOException Copies information from the http request to the output stream using the specified content length.- Parameters:
req
- Requestoutput
- Output stream- Throws:
IOException
- on error
-
copyThenClose
Copies information between specified streams and then closes both of the streams.- Parameters:
output
- outputinput
- input- Throws:
IOException
- on error
-
getBytes
- Parameters:
input
- input stream- Returns:
- a byte[] containing the information contained in the specified InputStream.
- Throws:
IOException
- on error
-
getRemoteAddresses
Return all remote addresses that were involved in the passed request.- Parameters:
request
- request- Returns:
- remote addresses
-