Package org.microproxy.http
Class DefaultLastHttpContent
java.lang.Object
org.microproxy.http.DefaultHttpContent
org.microproxy.http.DefaultLastHttpContent
- All Implemented Interfaces:
HttpContent,HttpObject,LastHttpContent
public non-sealed class DefaultLastHttpContent
extends DefaultHttpContent
implements LastHttpContent
The last piece of a message body, with optional trailers.
-
Constructor Summary
ConstructorsConstructorDescriptionCreates an empty last-content marker with no trailers.DefaultLastHttpContent(byte[] content) Creates a final body piece with no trailers.DefaultLastHttpContent(byte[] content, HttpHeaders trailingHeaders) Creates a final body piece with the supplied trailers. -
Method Summary
Modifier and TypeMethodDescriptionsetContent(byte[] content) Replaces the body bytes of this piece.Returns the mutable trailer fields following the body.Methods inherited from class org.microproxy.http.DefaultHttpContent
content, toStringMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.microproxy.http.HttpContent
content, contentAsString, contentAsString, contentLength
-
Constructor Details
-
DefaultLastHttpContent
public DefaultLastHttpContent()Creates an empty last-content marker with no trailers. -
DefaultLastHttpContent
public DefaultLastHttpContent(byte[] content) Creates a final body piece with no trailers.- Parameters:
content- body bytes, retained without copying
-
DefaultLastHttpContent
Creates a final body piece with the supplied trailers.- Parameters:
content- body bytes, retained without copyingtrailingHeaders- mutable trailer fields, retained without copying
-
-
Method Details
-
trailingHeaders
Description copied from interface:LastHttpContentReturns the mutable trailer fields following the body.- Specified by:
trailingHeadersin interfaceLastHttpContent- Returns:
- the mutable trailer fields following the body
-
setContent
Description copied from interface:HttpContentReplaces the body bytes of this piece.- Specified by:
setContentin interfaceHttpContent- Specified by:
setContentin interfaceLastHttpContent- Overrides:
setContentin classDefaultHttpContent- Parameters:
content- new backing array, retained without copying- Returns:
- this content object
-