Binary Class

From RemObjects Software

Jump to: navigation, search

This is a RemObjects SDK Architecture entry
Feel free to add your notes to this topic below.



Overview (.NET)

The Binary class is used to represent binary data that is sent between client and server. The Binary class extends the System.IO.MemoryStream class to add some helper methods for working with Binaries.

Namespace

Declaration (C#)

public class Binary : MemoryStream;

Hierarchy

  • MemoryStream
    • Binary

Methods

Method
Description
Binary The Binary type provides overloaded constructors that allow you to create pre-initialized Binary instances.
LoadFromStream Loads the Binary by reading data from the given stream.

The Position of the Binary will be reset before the load and the entire data in the Binary will be replaced with the data from the passed stream.

SaveToStream Saves the entire data from the Binary to the given stream.
LoadFromString Uses aValue to load the stream from a string by converting it to a byte array before writing it to the stream.

The string representation of the Binary can be accessed via the ToString() method.

Read Reads a block of bytes from the current stream and writes the data to buffer.
Write Writes a block of bytes to the current stream using data read from buffer.
ToString Overrides Object.ToString() to return a string representation of the Stream.

This conversion is done using the StreamToString() method in the StreamHelpers class. A Binary instance can be loaded from a string using the LoadFromString() method or via the overloaded constructor.


See Also


Product: RemObjects SDK
Current version: RemObjects SDK 'Vinci' (5.0)

ListsGlossaryFeaturesHow ToComponentsToolsSamplesArticlesArchitectureIssues

Personal tools