public abstract class Content
extends java.lang.Object
implements com.aspose.ms.System.IDisposable
Represents a base class for an HTTP entity body and content headers.
| Modifier and Type | Field and Description |
|---|---|
static com.aspose.ms.System.Text.Encoding |
DEFAULT_HTTP_ENCODING |
static com.aspose.ms.System.Text.Encoding |
DEFAULT_STRING_ENCODING |
| Modifier | Constructor and Description |
|---|---|
protected |
Content()
Initializes a new instance of the
Content class. |
| Modifier and Type | Method and Description |
|---|---|
void |
dispose()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
|
protected void |
dispose(boolean disposing)
Releases unmanaged and - optionally - managed resources.
|
ContentHeaders |
getHeaders()
Gets the HTTP content headers.
|
byte[] |
readAsByteArray()
Serialize the HTTP content and return a byte array that represents the content.
|
com.aspose.ms.System.IO.Stream |
readAsStream()
Serialize the HTTP content and return a stream that represents the content.
|
java.lang.String |
readAsString()
Serialize the HTTP content and return a string that represents the content.
|
protected abstract void |
serializeToStream(com.aspose.ms.System.IO.Stream stream)
Serialize the content to a specified stream.
|
public static final com.aspose.ms.System.Text.Encoding DEFAULT_STRING_ENCODING
public static final com.aspose.ms.System.Text.Encoding DEFAULT_HTTP_ENCODING
protected Content()
Initializes a new instance of the Content class.
public ContentHeaders getHeaders()
Gets the HTTP content headers.
Value: The headers.protected abstract void serializeToStream(com.aspose.ms.System.IO.Stream stream)
Serialize the content to a specified stream.
stream - The stream.public com.aspose.ms.System.IO.Stream readAsStream()
Serialize the HTTP content and return a stream that represents the content.
public byte[] readAsByteArray()
Serialize the HTTP content and return a byte array that represents the content.
public java.lang.String readAsString()
Serialize the HTTP content and return a string that represents the content.
protected void dispose(boolean disposing)
Releases unmanaged and - optionally - managed resources.
disposing - true to release both managed and unmanaged resources; false to release only unmanaged resources.public void dispose()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
dispose in interface com.aspose.ms.System.IDisposable