Diffusion .NET Client Library  6.1.5
 All Classes Namespaces Functions Variables Enumerations Enumerator Properties Events Pages
PushTechnology.ClientInterface.Client.Content.IContent Interface Reference

Represents data content. More...

Inheritance diagram for PushTechnology.ClientInterface.Client.Content.IContent:
PushTechnology.ClientInterface.Data.IBytes

Public Member Functions

byte[] ToBytes ()
 Returns the content as an array of bytes. More...
 
string AsString ()
 Returns the content as a string. More...
 
- Public Member Functions inherited from PushTechnology.ClientInterface.Data.IBytes
Stream AsInputStream ()
 Returns the data as a read-only stream. More...
 
byte[] ToByteArray ()
 Returns a copy of the data as a byte array. More...
 
void CopyTo (Stream outputStream)
 Writes the data to an output stream. More...
 

Properties

ContentEncoding Encoding [get]
 Returns the content encoding. More...
 
- Properties inherited from PushTechnology.ClientInterface.Data.IBytes
int Length [get]
 Returns the length of the data in bytes. More...
 

Detailed Description

Represents data content.

Content can represent the state of a topic or can be used to update a topic. Content may also form the body of a message sent to or from a client.

Content is immutable and can only be created using a IContentBuilder{TB} or by using convenience methods on IContentFactory.

Specialised subTypes of the builder are available for special data formats.

Content is essentially an array of bytes which can be formatted in various ways using builders or interpreted using readers.

Since: 5.0

NOTE : This interface is being phased out in favor of specific data types. The only remaining places where it must be used are in some of the IMessaging methods and in the Topics.Fetch methods. In all other cases its use should be avoided.

Member Function Documentation

string PushTechnology.ClientInterface.Client.Content.IContent.AsString ( )

Returns the content as a string.

Returns
The content as a string created by parsing the bytes as UTF-8.

The byte content is converted to a string using UTF-8 encoding.

byte [] PushTechnology.ClientInterface.Client.Content.IContent.ToBytes ( )

Returns the content as an array of bytes.

Returns
The internal array of bytes that represents the content.

This actually returns the internal byte array which must not be altered. If this data is to be manipulated in any way, it must first be copied.

Property Documentation

ContentEncoding PushTechnology.ClientInterface.Client.Content.IContent.Encoding
get

Returns the content encoding.

Returns
The content encoding.

This is the encoding that will be used for the content when transmitted over a compatible communications link. For inbound content this indicates the encoding that the content arrived with.


The documentation for this interface was generated from the following file: