Class Content
Namespace: Aspose.Svg.Net
Assembly: Aspose.SVG.dll (25.8.0)
Represents a base class for an HTTP entity body and content headers.
[ComVisible(true)]
public abstract class Content : IDisposable
Inheritance
Derived
ByteArrayContent , MultipartContent , StreamContent
Implements
Inherited Members
object.GetType() , object.MemberwiseClone() , object.ToString() , object.Equals(object?) , object.Equals(object?, object?) , object.ReferenceEquals(object?, object?) , object.GetHashCode()
Constructors
Content()
Initializes a new instance of the Aspose.Svg.Net.Content class. Since content is not passed when using this constructor, it is necessary to override the SerializeToStream method to obtain it.
protected Content()
Content(byte[])
Initializes a new instance of the Aspose.Svg.Net.Content class.
protected Content(byte[] content)
Parameters
content
byte
[]
The content as byte array.
Exceptions
Content is null.
Properties
Headers
Gets the HTTP content headers.
public ContentHeaders Headers { get; }
Property Value
Methods
Dispose(bool)
Releases unmanaged and - optionally - managed resources.
protected virtual void Dispose(bool disposing)
Parameters
disposing
bool
true
to release both managed and unmanaged resources; false
to release only unmanaged resources.
Dispose()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
public void Dispose()
ReadAsByteArray()
Serialize the HTTP content and return a byte array that represents the content.
public byte[] ReadAsByteArray()
Returns
byte []
Serialized byte array that represents the content
ReadAsStream()
Serialize the HTTP content and return a stream that represents the content.
public Stream ReadAsStream()
Returns
Serialized stream that represents the content
ReadAsString()
Serialize the HTTP content and return a string that represents the content.
public string ReadAsString()
Returns
Serialized string that represents the content
SerializeToStream(Stream)
Serialize the content to a specified stream. If a class is created with a constructor without parameters, then this method must be overriden.
protected virtual void SerializeToStream(Stream stream)
Parameters
stream
Stream
The stream.
Exceptions
Raised if content is null. It should be passed via constructor or this method should be overriden.