Class ServletUtils

java.lang.Object
org.red5.server.net.servlet.ServletUtils

public class ServletUtils extends Object
  • Field Details

    • DEFAULT_BUFFER_SIZE

      public static final int DEFAULT_BUFFER_SIZE
      Default value is 2048.
      See Also:
  • Constructor Details

    • ServletUtils

      public ServletUtils()
  • Method Details

    • copy

      public static void copy(InputStream input, OutputStream output) throws IOException
      Copies information from the input stream to the output stream using a default buffer size of 2048 bytes.
      Parameters:
      input - input
      output - output
      Throws:
      IOException - on error
    • copy

      public static void copy(InputStream input, OutputStream output, int bufferSize) throws IOException
      Copies information from the input stream to the output stream using the specified buffer size
      Parameters:
      input - input
      output - output
      bufferSize - buffer size
      Throws:
      IOException - on error
    • copy

      public static void copy(javax.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 - Request
      output - Output stream
      Throws:
      IOException - on error
    • copyThenClose

      public static void copyThenClose(InputStream input, OutputStream output) throws IOException
      Copies information between specified streams and then closes both of the streams.
      Parameters:
      input - input
      output - output
      Throws:
      IOException - on error
    • getBytes

      public static byte[] getBytes(InputStream input) throws IOException
      Parameters:
      input - input stream
      Returns:
      a byte[] containing the information contained in the specified InputStream.
      Throws:
      IOException - on error
    • getRemoteAddresses

      public static List<String> getRemoteAddresses(javax.servlet.http.HttpServletRequest request)
      Return all remote addresses that were involved in the passed request.
      Parameters:
      request - request
      Returns:
      remote addresses