Interface IBytes
- Namespace
- PushTechnology.ClientInterface.Data
- Assembly
- Diffusion.Client.dll
The read-only interface for values that are internally represented as binary data.
public interface IBytes
Remarks
This interface provides access to copies of the binary data, making instances effectively immutable.
Since: 5.8
Properties
Length
Returns the length of the data in bytes.
int Length { get; }
Property Value
- int
The length of the data in bytes.
Methods
AsInputStream()
Returns the data as a read-only stream.
Stream AsInputStream()
Returns
- Stream
The read-only stream.
CopyTo(Stream)
Writes the data to an output stream.
void CopyTo(Stream outputStream)
Parameters
outputStreamStreamThe target output stream.
Remarks
This method avoids the allocation and copying costs of producing an intermediate byte array using ToByteArray().
Exceptions
- ArgumentNullException
outputStreamisnull.- IOException
An I/O error occurs.
- NotSupportedException
The
outputStreamstream does not support writing, or the stream is already closed.- ObjectDisposedException
Methods were called after the
outputStreamstream was closed.
ToByteArray()
Returns a copy of the data as a byte array.
byte[] ToByteArray()
Returns
- byte[]
The copy of the binary data.