Class DefaultHttpContent

java.lang.Object
org.microproxy.http.DefaultHttpContent
All Implemented Interfaces:
HttpContent, HttpObject
Direct Known Subclasses:
DefaultLastHttpContent

public non-sealed class DefaultHttpContent extends Object implements HttpContent
A piece of message body.
  • Constructor Details

    • DefaultHttpContent

      public DefaultHttpContent(byte[] content)
      Creates a body piece backed by the supplied array.
      Parameters:
      content - body bytes, retained without copying
  • Method Details

    • content

      public byte[] content()
      Description copied from interface: HttpContent
      Returns the live backing array of body bytes, not a copy.
      Specified by:
      content in interface HttpContent
      Returns:
      the live backing array of body bytes, not a copy
    • setContent

      public HttpContent setContent(byte[] content)
      Description copied from interface: HttpContent
      Replaces the body bytes of this piece.
      Specified by:
      setContent in interface HttpContent
      Parameters:
      content - new backing array, retained without copying
      Returns:
      this content object
    • toString

      public String toString()
      Overrides:
      toString in class Object