C# Class Test.MiniCBOR

Contains lightweight methods for reading and writing CBOR data.
Afficher le fichier Open project: peteroupc/CBOR Class Usage Examples

Méthodes publiques

Méthode Description
ReadBoolean ( Stream stream ) : bool
ReadDouble ( Stream stream ) : double

Reads a double-precision floating point number in CBOR format from a data stream.

ReadInt32 ( Stream stream ) : int

Reads a 32-bit integer in CBOR format from a data stream. If the object read is a floating-point number, it is truncated to an integer.

WriteBoolean ( bool value, Stream stream ) : void
WriteInt32 ( int value, Stream stream ) : void

Private Methods

Méthode Description
HalfPrecisionToSingle ( int value ) : float
ReadFP ( Stream stream, int headByte ) : double
ReadInteger ( Stream stream, int headByte, bool check32bit ) : long
ToDouble ( long value ) : double
ToSingle ( int value ) : float

Method Details

ReadBoolean() public static méthode

public static ReadBoolean ( Stream stream ) : bool
stream Stream
Résultat bool

ReadDouble() public static méthode

Reads a double-precision floating point number in CBOR format from a data stream.
The end of the stream was /// reached, or the object read isn't a number. The parameter is null.
public static ReadDouble ( Stream stream ) : double
stream Stream A data stream.
Résultat double

ReadInt32() public static méthode

Reads a 32-bit integer in CBOR format from a data stream. If the object read is a floating-point number, it is truncated to an integer.
The end of the stream was /// reached, or the object read isn't a number, or can't fit a 32-bit /// integer. The parameter is null.
public static ReadInt32 ( Stream stream ) : int
stream Stream A data stream.
Résultat int

WriteBoolean() public static méthode

public static WriteBoolean ( bool value, Stream stream ) : void
value bool
stream Stream
Résultat void

WriteInt32() public static méthode

public static WriteInt32 ( int value, Stream stream ) : void
value int
stream Stream
Résultat void