Class ServletUtils

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

public class ServletUtils extends Object
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final int
    Default value is 2048.
    private static org.slf4j.Logger
     
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static 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 size
    static void
    Copies information between specified streams and then closes both of the streams.
    static byte[]
     
    static List<String>
    getRemoteAddresses(jakarta.servlet.http.HttpServletRequest request)
    Return all remote addresses that were involved in the passed request.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • log

      private static org.slf4j.Logger log
    • 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
      bufferSize - buffer size
      output - 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 - 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:
      output - output
      input - input
      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(jakarta.servlet.http.HttpServletRequest request)
      Return all remote addresses that were involved in the passed request.
      Parameters:
      request - request
      Returns:
      remote addresses