Package org.microproxy.http
Class DefaultHttpContent
java.lang.Object
org.microproxy.http.DefaultHttpContent
- All Implemented Interfaces:
HttpContent,HttpObject
- Direct Known Subclasses:
DefaultLastHttpContent
A piece of message body.
-
Constructor Summary
ConstructorsConstructorDescriptionDefaultHttpContent(byte[] content) Creates a body piece backed by the supplied array. -
Method Summary
Modifier and TypeMethodDescriptionbyte[]content()Returns the live backing array of body bytes, not a copy.setContent(byte[] content) Replaces the body bytes of this piece.toString()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.microproxy.http.HttpContent
contentAsString, contentAsString, contentLength
-
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:HttpContentReturns the live backing array of body bytes, not a copy.- Specified by:
contentin interfaceHttpContent- Returns:
- the live backing array of body bytes, not a copy
-
setContent
Description copied from interface:HttpContentReplaces the body bytes of this piece.- Specified by:
setContentin interfaceHttpContent- Parameters:
content- new backing array, retained without copying- Returns:
- this content object
-
toString
-