com.aspose.html.net

Class Content

  • java.lang.Object
    • com.aspose.html.net.Content
  • All Implemented Interfaces:
    com.aspose.ms.System.IDisposable
    Direct Known Subclasses:
    ByteArrayContent, MultipartContent, StreamContent


    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.

    • Constructor Summary

      Constructors 
      Modifier Constructor and Description
      protected Content()
      Initializes a new instance of the Content class.
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      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.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • DEFAULT_STRING_ENCODING

        public static final com.aspose.ms.System.Text.Encoding DEFAULT_STRING_ENCODING
      • DEFAULT_HTTP_ENCODING

        public static final com.aspose.ms.System.Text.Encoding DEFAULT_HTTP_ENCODING
    • Constructor Detail

      • Content

        protected Content()

        Initializes a new instance of the Content class.

    • Method Detail

      • getHeaders

        public ContentHeaders getHeaders()

        Gets the HTTP content headers.

        Value: The headers.
      • serializeToStream

        protected abstract void serializeToStream(com.aspose.ms.System.IO.Stream stream)

        Serialize the content to a specified stream.

        Parameters:
        stream - The stream.
      • readAsStream

        public com.aspose.ms.System.IO.Stream readAsStream()

        Serialize the HTTP content and return a stream that represents the content.

        Returns:
        Serialized stream that represents the content
      • readAsByteArray

        public byte[] readAsByteArray()

        Serialize the HTTP content and return a byte array that represents the content.

        Returns:
        Serialized byte array that represents the content
      • readAsString

        public java.lang.String readAsString()

        Serialize the HTTP content and return a string that represents the content.

        Returns:
        Serialized string that represents the content
      • dispose

        protected void dispose(boolean disposing)

        Releases unmanaged and - optionally - managed resources.

        Parameters:
        disposing - true to release both managed and unmanaged resources; false to release only unmanaged resources.
      • dispose

        public void dispose()

        Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

        Specified by:
        dispose in interface com.aspose.ms.System.IDisposable