Diffusion .NET API  5.9.24
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Properties Events Pages
PushTechnology.ClientInterface.Data.IBytes Interface Reference

Represents a read-only interface for values that are internally represented as binary data. More...

Inheritance diagram for PushTechnology.ClientInterface.Data.IBytes:
PushTechnology.ClientInterface.Client.Content.IContent PushTechnology.ClientInterface.Data.Binary.IBinary PushTechnology.ClientInterface.Data.JSON.IJSON

Public Member Functions

Stream AsInputStream ()
 Returns a stream that provides the data. More...
 
byte[] ToByteArray ()
 Returns a copy of the data as a byte array. More...
 
void CopyTo (Stream outputStream)
 Writes the bytes to an output stream. More...
 

Properties

int Length [get]
 Returns the length of the data in bytes. More...
 

Detailed Description

Represents a read-only interface for values that are internally represented as binary data.

This interface provides access to copies of the binary data, making instances effectively immutable. Methods of derived interfaces and classes that relax this restriction and expose access to the internal data should be clearly documented.



Since: 5.7

Member Function Documentation

Stream PushTechnology.ClientInterface.Data.IBytes.AsInputStream ( )

Returns a stream that provides the data.

Returns
The stream that provides the data.
void PushTechnology.ClientInterface.Data.IBytes.CopyTo ( Stream  outputStream)

Writes the bytes to an output stream.

Parameters
outputStreamThe target output stream.

This method avoids the allocation and copying costs of producing an intermediate byte array via ToByteArray().

Exceptions
ArgumentNullExceptionThe target output stream is null.
IOExceptionWriting to the target output stream failed.
byte [] PushTechnology.ClientInterface.Data.IBytes.ToByteArray ( )

Returns a copy of the data as a byte array.

Returns
A copy of the binary data.

Property Documentation

int PushTechnology.ClientInterface.Data.IBytes.Length
get

Returns the length of the data in bytes.


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